Improving real-time style change for users

This commit is contained in:
BlackLight 2011-01-08 17:00:53 +01:00
parent 4507ef5d06
commit 3a532f2521
6 changed files with 64 additions and 21 deletions

View File

@ -184,6 +184,22 @@
{
shell.json[i] = blashrc[i];
}
if ( blashrc['banner'] )
{
if ( document.getElementById ( 'banner' ))
{
document.getElementById ( 'banner' ).innerHTML = blashrc['banner'] + '<br/><br/>';
}
}
if ( blashrc['promptText'] )
{
if ( document.getElementById ( 'promptText' ))
{
document.getElementById ( 'promptText' ).innerHTML = shell.unescapePrompt ( blashrc['promptText'], shell.json.promptSequences );
}
}
}
if ( stylercIndex > 0 )

View File

@ -351,6 +351,36 @@ switch ( $action )
print set_content ( $file, $content );
break;
case 'list':
if ( !( $xml = new SimpleXMLElement ( $xmlcontent )))
{
print "Unable to open the users XML file\n";
return false;
}
$users = array();
for ( $i = 0; $i < count ( $xml->user ); $i++ )
{
array_push ( $users, $xml->user[$i]['name'] );
}
sort ( $users, SORT_STRING );
foreach ( $users as $i => $user )
{
print $user;
if ( $i < count ( $users ) - 1 )
{
print "<br/>";
}
print "\n";
}
break;
default :
print "Unallowed action\n";
break;

View File

@ -268,6 +268,22 @@ function blash ()
{
shell.json[i] = blashrc[i];
}
if ( blashrc['banner'] )
{
if ( document.getElementById ( 'banner' ))
{
document.getElementById ( 'banner' ).innerHTML = blashrc['banner'] + '<br/><br/>';
}
}
if ( blashrc['promptText'] )
{
if ( document.getElementById ( 'promptText' ))
{
document.getElementById ( 'promptText' ).innerHTML = shell.unescapePrompt ( blashrc['promptText'], shell.json.promptSequences );
}
}
}
if ( stylercIndex > 0 )

View File

@ -74,6 +74,7 @@
"touch",
"useradd",
"userdel",
"users",
"whoami"
]
}

View File

@ -3,7 +3,7 @@
*/
{
"banner" : "Welcome back to blash<br/><br/>",
"banner" : "Welcome back to blash",
"machine" : "localhost",
/**

View File

@ -33,26 +33,6 @@
"path" : "/home",
"type" : "directory"
},
{
"path" : "/home/guest",
"type" : "directory"
},
{
"path" : "/home/guest/mbox",
"type" : "file",
"content" : "No new mail"
},
{
"path" : "/home/blacklight",
"type" : "directory",
"can_read" : "blacklight",
"can_write" : "blacklight"
},
{
"path" : "/home/blacklight/mbox",
"type" : "file",
"content" : "No new mail"
},
{
"path" : "/google",
"type" : "file",