' . $words->__get('new filename') . ':
+ (' . $words->__get('you can also move the file by specifying a path') . ')
+ ');
}
case 'delete':
{
@@ -454,15 +455,10 @@ class Admin
}
global $words, $subdir;
throw new ExceptionDisplay('
'
- . $words -> __get('are you sure you want to delete the file')
- . ' ' . Url::html_output($_GET['filename']) . '?
'
- . '');
+ . $words->__get('are you sure you want to delete the file') . ' ' . Url::html_output($_GET['filename']) . '?
'
+ . '');
}
case 'add_user':
{
@@ -472,29 +468,29 @@ class Admin
$_POST['pass2'], (int)$_POST['level'], $_POST['home_dir']);
}
global $words;
- throw new ExceptionDisplay($words -> __get('add user')
+ throw new ExceptionDisplay($words->__get('add user')
. ':');
+ . $words->__get('add user') . '" />');
}
case 'change_password':
{
if (isset($_POST['pass1'], $_POST['pass2'], $_POST['old_pass']))
{
- self::change_password($this -> username, $_POST['old_pass'],
+ self::change_password($this->username, $_POST['old_pass'],
$_POST['pass1'], $_POST['pass2']);
}
throw new ExceptionDisplay('');
+ . $words->__get('guest') . ' ');
}
case 'del_user':
{
@@ -531,23 +527,23 @@ class Admin
}
global $words;
throw new ExceptionDisplay('
'
- . $words -> __get('are you sure you want to remove the user')
+ . $words->__get('are you sure you want to remove the user')
. ' '.$_POST['username'] . '?
' . $words -> __get('select user to remove')
- . ':
');
+ throw new ExceptionDisplay($out . '');
}
case 'edit_description':
{
@@ -558,11 +554,11 @@ class Admin
if (isset($_GET['description']))
{
global $descriptions, $config;
- if (DESCRIPTION_FILE && $descriptions -> is_set($filename))
+ if (DESCRIPTION_FILE && $descriptions->is_set($filename))
//if it's already set, update the old description
{
//update the new description on disk
- $h = @fopen($config -> __get('description_file'), 'wb');
+ $h = @fopen($config->__get('description_file'), 'wb');
if ($h === false)
{
throw new ExceptionDisplay('Could not open description file for writing.' . ' Make sure PHP has write permission to this file.');
@@ -574,12 +570,12 @@ class Admin
fclose($h);
//update the new description in memory
- $descriptions -> set($filename, $_GET['description']);
+ $descriptions->set($filename, $_GET['description']);
}
else if ($_GET['description'] != '')
//if it's not set, add it to the end
{
- $h = @fopen($config -> __get('description_file'), 'ab');
+ $h = @fopen($config->__get('description_file'), 'ab');
if ($h === false)
{
throw new ExceptionDisplay('Could not open description file for writing.' . ' Make sure PHP has write permission to this file.');
@@ -588,24 +584,24 @@ class Admin
fclose($h);
//read the description file with the updated data
- $descriptions = new ConfigData($config -> __get('description_file'));
+ $descriptions = new ConfigData($config->__get('description_file'));
}
}
else
{
global $words, $subdir, $descriptions;
- $current_desc = (DESCRIPTION_FILE && $descriptions -> is_set($filename) ? $descriptions -> __get($filename) : '');
+ $current_desc = (DESCRIPTION_FILE && $descriptions->is_set($filename) ? $descriptions->__get($filename) : '');
throw new ExceptionDisplay('
'
- . $words -> __get('enter the new description for the file')
+ . $words->__get('enter the new description for the file')
. ' ' . Url::html_output($_GET['filename'])
- . ':
');
+ . $words->__get('change') . '" />');
}
}
else
@@ -624,7 +620,7 @@ class Admin
if (isset($_GET['add']) && $_GET['add'] != '')
{
global $config;
- $h = @fopen($config -> __get('hidden_files'), 'ab');
+ $h = @fopen($config->__get('hidden_files'), 'ab');
if ($h === false)
{
throw new ExceptionDisplay('Unable to open hidden files list for writing.');
@@ -636,7 +632,7 @@ class Admin
if (isset($_GET['remove']))
{
global $config;
- $h = @fopen($config -> __get('hidden_files'), 'wb');
+ $h = @fopen($config->__get('hidden_files'), 'wb');
if ($h === false)
{
throw new ExceptionDisplay('Unable to open hidden files list for writing.');
@@ -652,23 +648,23 @@ class Admin
throw new ExceptionDisplay('Hidden file removed.');
}
global $words;
- $str = '
' . $words -> __get('add a new hidden file') . ':
'
+ $str = '
' . $words->__get('add a new hidden file') . ':
'
. '
You can also use wildcards (?, *, +) for each entry. '
. 'If you want to do the opposite of "hidden files" - show only certain files - '
. 'put a colon in front of those entries.
';
+ . $words->__get('remove') . '" />';
throw new ExceptionDisplay($str);
}
case 'edit_banned':
@@ -677,10 +673,11 @@ class Admin
{
throw new ExceptionDisplay('The banning system is not in use. To enable it, reconfigure the script.');
}
+
if (isset($_GET['add']) && $_GET['add'] != '')
{
global $config;
- $h = @fopen($config -> __get('banned_list'), 'ab');
+ $h = @fopen($config->__get('banned_list'), 'ab');
if ($h === false)
{
throw new ExceptionDisplay('Unable to open banned_list for writing.');
@@ -689,14 +686,18 @@ class Admin
fclose($h);
throw new ExceptionDisplay('Ban added.');
}
+
if (isset($_GET['remove']))
{
global $b_list, $config;
- $h = @fopen($config -> __get('banned_list'), 'wb');
+
+ $h = @fopen($config->__get('banned_list'), 'wb');
+
if ($h === false)
{
throw new ExceptionDisplay('Unable to open banned_list for writing.');
}
+
foreach ($b_list as $ban)
{
if ($ban != $_GET['remove'])
@@ -707,21 +708,32 @@ class Admin
fclose($h);
throw new ExceptionDisplay('Ban removed.');
}
- global $b_list, $words;
- $str = '
' . $words -> __get('add a new ban') . ':
';
- $str .= '
'
- . $words -> __get('remove a ban') . ':
';
throw new ExceptionDisplay($str);
}
case 'stats':
@@ -731,7 +743,7 @@ class Admin
throw new ExceptionDisplay('The logging system has not been enabled.');
}
$stats = new Stats();
- $stats -> display();
+ $stats->display();
break;
}
case 'view_log':
@@ -743,14 +755,14 @@ class Admin
global $log;
if (isset($_GET['num']))
{
- $log -> display((int)$_GET['num']);
+ $log->display((int)$_GET['num']);
}
- global $words;
- throw new ExceptionDisplay($words -> __get('how many entries would you like to view')
- . '?
'
. '
');
+ . $words->__get('view') . '" />');
}
case 'create_dir':
{
@@ -765,11 +777,11 @@ class Admin
else
{
global $words, $subdir;
- throw new ExceptionDisplay('
' . $words -> __get('enter the new name')
+ throw new ExceptionDisplay('