]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-admins_edit.php
Renamed function so it might be more understandable
[mailer.git] / inc / modules / admin / what-admins_edit.php
index e4aaee886fb1e0c1709d4daa152aa50ae7ae65da..e779bc00e44c3d2b25aa12d08c18e497048df717 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 04/18/2004 *
- * ================                             Last change: 04/18/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 04/18/2004 *
+ * ===================                          Last change: 04/18/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-admins_edit.php                             *
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Admin-Account editieren                          *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
 
 // Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
-
-// Instance for the cache extension
-global $cacheInstance;
+addYouAreHereLink('admin', __FILE__);
 
 // Set selection data to empty array when it is empty
-if (empty($_POST['sel'])) $_POST['sel'] = array();
+if (!isPostRequestParameterSet('sel')) setPostRequestParameter('sel', array());
 
 // Check if direct admin account was selected
-if (!empty($_GET['admin'])) {
-       // Secure ID number
-       $aid = bigintval($_GET['admin']);
-       $_POST['edit'] = "1";
-       $_POST['sel'][$aid] = "1";
-}
+if (isGetRequestParameterSet('admin')) {
+       // Secure id number
+       $adminId = bigintval(getRequestParameter('admin'));
+
+       // Set required fields
+       setPostRequestParameter('edit', 1);
+       setPostRequestParameter('sel', array($adminId => 1));
+} // END - if
 
-if ((isset($_POST['edit'])) && (SELECTION_COUNT($_POST['sel']) > 0)) {
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
        // Edit account(s)
-       ADMINS_EDIT_ADMIN_ACCOUNTS($_POST);
-} elseif ((isset($_POST['change'])) && (sizeof($_POST['login']) > 0)) {
+       adminsEditAdminAccount(postRequestArray());
+} elseif ((isFormSent('change')) && (count(postRequestParameter('login')) > 0)) {
        // Change admin accounts
-       ADMINS_CHANGE_ADMIN_ACCOUNT($_POST);
-} elseif ((isset($_POST['del'])) && (SELECTION_COUNT($_POST['sel']) > 0)) {
+       adminsChangeAdminAccount(postRequestArray());
+} elseif ((isFormSent('delete')) && (ifPostContainsSelections())) {
        // Show admin accounts for deletetion
-       ADMINS_DELETE_ADMIN_ACCOUNTS($_POST);
+       adminsDeleteAdminAccount(postRequestArray());
 } else {
-       if ((isset($_POST['remove'])) && (SELECTION_COUNT($_POST['sel']) > 0)) {
+       if ((isFormSent('remove')) && (ifPostContainsSelections())) {
                // Remove accounts now
-               ADMINS_REMOVE_ADMIN_ACCOUNTS($_POST);
-       }
+               adminsRemoveAdminAccount(postRequestArray());
+       } // END - if
 
        // List all admin accounts
-       ADMINS_LIST_ADMIN_ACCOUNTS();
+       adminsListAdminAccounts();
 }
 
-//
+// [EOF]
 ?>