add_session(ERROR_ADMINISTRATOR_EXISTS, 'error'); } tep_redirect(tep_href_link(FILENAME_ADMINISTRATORS)); break; case 'save': require('includes/functions/password_funcs.php'); $username = tep_db_prepare_input($HTTP_POST_VARS['username']); $password = tep_db_prepare_input($HTTP_POST_VARS['password']); $check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " where user_name = '" . tep_db_input($admin['username']) . "'"); $check = tep_db_fetch_array($check_query); if ($admin['id'] == $check['id']) { $admin['username'] = $username; } tep_db_query("update " . TABLE_ADMINISTRATORS . " set user_name = '" . tep_db_input($username) . "' where id = '" . (int)$HTTP_GET_VARS['aID'] . "'"); if (tep_not_null($password)) { tep_db_query("update " . TABLE_ADMINISTRATORS . " set user_password = '" . tep_db_input(tep_encrypt_password($password)) . "' where id = '" . (int)$HTTP_GET_VARS['aID'] . "'"); } tep_redirect(tep_href_link(FILENAME_ADMINISTRATORS, 'aID=' . (int)$HTTP_GET_VARS['aID'])); break; case 'deleteconfirm': $id = tep_db_prepare_input($HTTP_GET_VARS['aID']); $check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " where user_name = '" . tep_db_input($admin['username']) . "'"); $check = tep_db_fetch_array($check_query); if ($id == $check['id']) { tep_session_unregister('admin'); } tep_db_query("delete from " . TABLE_ADMINISTRATORS . " where id = '" . (int)$id . "'"); tep_redirect(tep_href_link(FILENAME_ADMINISTRATORS)); break; } } ?> > <?php echo TITLE; ?>
'' . TEXT_INFO_HEADING_NEW_ADMINISTRATOR . ''); $contents = array('form' => tep_draw_form('administrator', FILENAME_ADMINISTRATORS, 'action=insert')); $contents[] = array('text' => TEXT_INFO_INSERT_INTRO); $contents[] = array('text' => '
' . TEXT_INFO_USERNAME . '
' . tep_draw_input_field('username')); $contents[] = array('text' => '
' . TEXT_INFO_PASSWORD . '
' . tep_draw_password_field('password')); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'edit': $heading[] = array('text' => '' . $aInfo->user_name . ''); $contents = array('form' => tep_draw_form('administrator', FILENAME_ADMINISTRATORS, 'aID=' . $aInfo->id . '&action=save')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); $contents[] = array('text' => '
' . TEXT_INFO_USERNAME . '
' . tep_draw_input_field('username', $aInfo->user_name)); $contents[] = array('text' => '
' . TEXT_INFO_NEW_PASSWORD . '
' . tep_draw_password_field('password')); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'delete': $heading[] = array('text' => '' . $aInfo->user_name . ''); $contents = array('form' => tep_draw_form('administrator', FILENAME_ADMINISTRATORS, 'aID=' . $aInfo->id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
' . $aInfo->user_name . ''); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_delete.gif', IMAGE_UPDATE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: if (isset($aInfo) && is_object($aInfo)) { $heading[] = array('text' => '' . $aInfo->user_name . ''); $contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '' . tep_image_button('button_delete.gif', IMAGE_DELETE) . ''); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' ' . "\n"; } ?>
id) ) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?>
 
id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
' . tep_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '