diff --git a/create-admin.php b/create-admin.php deleted file mode 100644 index b8ade2b3..00000000 --- a/create-admin.php +++ /dev/null @@ -1,68 +0,0 @@ -assign ('mode', 'create'); -$smarty->assign ('tUsername', $tUsername); -$smarty->assign ('pAdminCreate_admin_username_text', $PALANG['pAdminCreate_admin_username_text']); -$smarty->assign ('pAdminCreate_admin_username_text_error', $pAdminCreate_admin_username_text_error, false); -$smarty->assign ('admin_password_text_error', $pAdminCreate_admin_password_text_error, false); -$smarty->assign ('select_options', select_options ($list_domains, $tDomains), false); - -$smarty->assign ('smarty_template', 'admin_edit-admin'); -$smarty->display ('index.tpl'); - -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ -?> diff --git a/edit-admin.php b/edit-admin.php deleted file mode 100644 index 2d105e74..00000000 --- a/edit-admin.php +++ /dev/null @@ -1,164 +0,0 @@ - 0) { - $pAdminEdit_admin_password_text_error = $validpass[0]; # TODO: honor all error messages, not only the first one - $error = 1; - } - } - else { - $error = 1; - $pAdminEdit_admin_password_text_error = $PALANG['pAdminEdit_admin_password_text_error']; - } - } - } - $fDomains = array(); - if (array_key_exists('fDomains', $_POST)) $fDomains = escape_string ($_POST['fDomains']); - if ($error != 1) - { - if ($fActive == "on") { - $sqlActive = db_get_boolean(True); - } - else { - $sqlActive = db_get_boolean(False); - } - - $password_query = ''; - if ($fPassword != '') { # do not change password to empty one - $fPassword = pacrypt($fPassword); - $password_query = ", password='$fPassword'"; - } - $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive' $password_query WHERE username='$username'"); - - if ($fSadmin == "on") $fSadmin = 'ALL'; - - // delete everything, and put it back later on.. - db_query("DELETE FROM $table_domain_admins WHERE username = '$username'"); - if($fSadmin == 'ALL') { - $fDomains = array('ALL'); - } - - foreach($fDomains as $domain) - { - $result = db_query ("INSERT INTO $table_domain_admins (username,domain,created) VALUES ('$username','$domain',NOW())"); - } - flash_info($PALANG['pAdminEdit_admin_result_success']); - header("Location: list-admin.php"); - exit(0); - } - else { - flash_error($PALANG['pAdminEdit_admin_result_error']); - } -} -if (isset($_GET['username'])) $username = escape_string ($_GET['username']); - -$tAllDomains = list_domains(); -$tDomains = list_domains_for_admin ($username); -$tActive_checked = ''; -$tPassword = $admin_details['password']; - -if($admin_details['active'] == 't' || $admin_details['active'] == 1) { - $tActive_checked = ' checked="checked"'; -} -$tSadmin_checked = ''; -$result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$username'"); -// could/should be multiple matches to query; -if ($result['rows'] >= 1) { - $result = $result['result']; - while($row = db_array($result)) { - if ($row['domain'] == 'ALL') { - $tSadmin_checked = ' checked="checked"'; - $tDomains = array(); /* empty the list, they're an admin */ - } - } -} - -$smarty->assign ('mode', 'edit'); -$smarty->assign ('username', $username); -$smarty->assign ('admin_password_text_error', $pAdminEdit_admin_password_text_error, false); -$smarty->assign ('tActive_checked', $tActive_checked); -$smarty->assign ('tSadmin_checked', $tSadmin_checked); -$smarty->assign ('select_options', select_options ($tAllDomains, $tDomains), false); -$smarty->assign ('smarty_template', 'admin_edit-admin'); -$smarty->display ('index.tpl'); - -/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ -?> diff --git a/templates/admin_edit-admin.tpl b/templates/admin_edit-admin.tpl deleted file mode 100644 index cd597318..00000000 --- a/templates/admin_edit-admin.tpl +++ /dev/null @@ -1,61 +0,0 @@ -
-
- - - - - - -{if $mode == 'edit'} - - -{else} - - - -{/if} - - - - - - - - - - - - -{if $mode == 'edit'} - - - - - - - - - - - -{/if} - - - - - - - - - - -
- {if $mode == 'edit'} - {$PALANG.pAdminEdit_admin_welcome} - {else} - {$PALANG.pAdminCreate_admin_welcome} - {/if} -
{$username} {$pAdminCreate_admin_username_text}{$pAdminCreate_admin_username_text_error}
 {$admin_password_text_error}
 
 
 
 
  
-
-