* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/includes/core.inc.php'; require_once dirname(__FILE__) . '/includes/page_template.php'; if (!checkAuthorization('viewConfiguration')) { redirect('index.php'); } page_header(); $prefs = Preferences::getInstance(); if (!$prefs) { die_error('get Preferences failed', __FILE__, __LINE__); } ?> <table style="width: 100%;" border="0" cellspacing="3" cellpadding="5"> <tr> <td style="padding: 20px; vertical-align: top;"> <div class="container rounded" style="background: #eee; width: 98%; margin-left: auto; margin-right: auto;"> <div>
* as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(dirname(__FILE__)) . '/includes/core.inc.php'; require_once dirname(dirname(__FILE__)) . '/includes/page_template.php'; require_once dirname(dirname(__FILE__)) . '/includes/webapp.inc.php'; if (!checkAuthorization('viewApplications')) { redirect(); } if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == 'manage') { if (isset($_REQUEST['id'])) { show_manage($_REQUEST['id']); } } } if (!isset($_GET['view'])) { $_GET['view'] = 'all'; } if ($_GET['view'] == 'all') { show_default(); }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(dirname(__FILE__)) . '/includes/core.inc.php'; require_once dirname(dirname(__FILE__)) . '/includes/page_template.php'; if (!checkAuthorization('viewNews')) { redirect('index.php'); } if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == 'rename' && isset($_REQUEST['id'])) { if (!checkAuthorization('manageNews')) { redirect(); } if (isset($_REQUEST['news_title']) && isset($_REQUEST['news_content'])) { $res = $_SESSION['service']->news_modify($_REQUEST['id'], $_REQUEST['news_title'], $_REQUEST['news_content']); if ($res === true) { popup_info(_('News successfully modified')); } } redirect(); } if ($_REQUEST['action'] == 'manage' && isset($_REQUEST['id'])) { show_manage($_REQUEST['id']); } } else { show_default();
* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(dirname(__FILE__)) . '/includes/core.inc.php'; require_once dirname(dirname(__FILE__)) . '/includes/page_template.php'; if (!checkAuthorization('viewSummary')) { redirect('index.php'); } function my_own_callback($matches) { return '<span class="' . strtolower($matches[1]) . '">' . trim($matches[0]) . '</span>'; } function get_error_code_translation($code_) { switch ($code_) { case 'time_restriction': return _('Time restriction policy'); case 'unauthorized_session_mode': return _('Unauthorized session mode'); case 'invalid_publications': return _('Invalid publications');
* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/includes/core.inc.php'; require_once dirname(__FILE__) . '/includes/page_template.php'; if (!checkAuthorization('viewStatus')) { redirect('index.php'); } if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == 'manage') { if (isset($_REQUEST['id'])) { show_manage($_REQUEST['id']); } } } show_default(); function get_sessions_history($from, $to, $user_login, $limit) { $extra = array(); if ($from != null && $to != null) { $extra[] = '@2>=%3';
$log['form_read return an error'] = false; return $log; } $log = $_SESSION['service']->settings_domain_integration_preview($prefs->export_elements($prefs->elements)); return $log; } try { $prefs = new Preferences_admin(); } catch (Exception $e) { // Error header sauvergarde } if (isset($_POST['config'])) { $name = $_POST['config']; $previous = $_POST['config_previous']; if ($name == $previous) { if (!checkAuthorization('manageConfiguration')) { redirect(); } $_SESSION['config_profile'] = $name; $_SESSION[$name] = $_POST; if (isset($_POST['submit_preview'])) { $preview = do_preview($prefs, $name); } else { $d = substr($name, strlen('Configuration_mode_')); if ($d == 'ad') { $d = 'microsoft'; } $prefs->set('general', 'domain_integration', $d); if (do_save($prefs, $name) === True) { $_SESSION['config_profile_saved'] = true; unset($_SESSION['config_profile']);
} else { $sessions_id = array($_REQUEST['session']); } foreach ($sessions_id as $sessions_id) { $ret = $_SESSION['service']->session_report_remove($sessions_id); if ($ret !== true) { popup_error(sprintf(_("Unable to delete archived session '%s'"), $sessions_id)); continue; } popup_info(sprintf(_("Archived session '%s' successfully deleted"), $sessions_id)); } } } if ($_REQUEST['name'] == 'Task') { // it is the rigth place ? (see similar block on name=server action=install_line if (!checkAuthorization('manageServers')) { redirect(); } if ($_REQUEST['action'] == 'add') { if (isset($_POST['type'])) { if ($_POST['type'] == 'upgrade') { $res = $_SESSION['service']->task_debian_upgrade($_REQUEST['server']); } else { if ($_POST['type'] == 'install_from_line') { $res = $_SESSION['service']->task_debian_install_packages($_REQUEST['server'], $_POST['request']); } else { redirect(); } } if ($res) { popup_info(_("Task successfully added"));
$offer = $_GET['ticket']; $admins = getAdministrators(); $admin = array_shift($admins); $req = getOption('admin_reset_date'); $adm = $admin['user']; $pas = $admin['pass']; $ref = md5($req . $adm . $pas); if ($ref === $offer) { if (time() <= $req + 3 * 24 * 60 * 60) { // you have one week to use the request setOption('admin_reset_date', NULL); } } } if (!isset($_POST['login'])) { $_zp_loggedin = checkAuthorization(zp_getCookie('zenphoto_auth')); if (!$_zp_loggedin) { // Clear the cookie zp_setcookie("zenphoto_auth", "", time() - 368000, $cookiepath); } } else { // Handle the login form. if (isset($_POST['login']) && isset($_POST['user']) && isset($_POST['pass'])) { $post_user = sanitize($_POST['user'], 3); $post_pass = sanitize($_POST['pass'], 3); $redirect = sanitize_path($_POST['redirect']); if ($_zp_loggedin = checkLogon($post_user, $post_pass)) { zp_setcookie("zenphoto_auth", passwordHash($post_user, $post_pass), time() + COOKIE_PESISTENCE, $cookiepath); if (!empty($redirect)) { header("Location: " . FULLWEBPATH . '/' . $redirect); }
* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(dirname(__FILE__)) . '/includes/core.inc.php'; require_once dirname(dirname(__FILE__)) . '/includes/page_template.php'; if (!checkAuthorization('viewSharedFolders')) { redirect('index.php'); } if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == 'manage' && isset($_REQUEST['id'])) { show_manage($_REQUEST['id']); } } else { show_default(); } function show_default() { $sharedfolders = $group = $_SESSION['service']->shared_folders_list(); if (is_null($sharedfolders)) { $sharedfolders = array(); }
<?php /** * edit_workorder.php * * Repair Shop Workorder System - update db records on workorder edit * * @version 1.0 * @author Alan Baker <*****@*****.**> * @copyright 2008, Plymouth State University, ITS */ if (!checkAuthorization($_SESSION['username'])) { exit("Authorization Required"); } $workorder = $_POST['wo']; $query = "SELECT note FROM shop_user_notes WHERE workorder_id=? ORDER BY id desc"; $args = array('workorder_id' => $workorder); $res = $GLOBALS['SYSTEMS_DB']->Execute($query, $args); $array = $res->FetchRow(); $user_note = $array['note']; $query = "SELECT note FROM shop_tech_notes WHERE workorder_id=? ORDER BY id desc"; $args = array('workorder_id' => $workorder); $res = $GLOBALS['SYSTEMS_DB']->Execute($query, $args); $array = $res->FetchRow(); $tech_note = $array['note']; $query = "SELECT current_status,university_owned,username, device_manufacturer, device_model, device_serial, university_owned, send_email, tech_assigned FROM shop_workorder WHERE id=?"; $args = array('id' => $workorder); $res = $GLOBALS['SYSTEMS_DB']->Execute($query, $args); $array = $res->FetchRow(); $current_status = $array['current_status']; $psu_property = $array['university_owned'];
function do_validate() { if ($_SESSION['wizard']['use_users'] == 'users') { if (!checkAuthorization('manageUsersGroups')) { redirect(); } $userGroupDB = UserGroupDB::getInstance(); if (!$userGroupDB->isWriteable()) { return false; } $g = new UsersGroup(NULL, $_SESSION['wizard']['user_group_name'], $_SESSION['wizard']['user_group_description'], 1); $res = $userGroupDB->add($g); if (!$res || !is_object($g) || $g->id == NULL) { popup_error(_('Cannot create usergroup')); } $users = $_SESSION['wizard']['users']; foreach ($users as $user) { Abstract_Liaison::save('UsersGroup', $user, $g->getUniqueID()); } $usergroups = array($g->getUniqueID()); } else { $usergroups = $_SESSION['wizard']['usergroups']; } if ($_SESSION['wizard']['use_apps'] == 'apps') { if (!checkAuthorization('manageApplicationsGroups')) { redirect(); } $g = new AppsGroup(NULL, $_SESSION['wizard']['application_group_name'], $_SESSION['wizard']['application_group_description'], 1); $applicationsGroupDB = ApplicationsGroupDB::getInstance(); $res = $applicationsGroupDB->add($g); if (!$res || !is_object($g) || $g->id == NULL) { popup_error(_('Cannot create application group')); } $apps = $_SESSION['wizard']['apps']; foreach ($apps as $app) { Abstract_Liaison::save('AppsGroup', $app, $g->id); } $appgroups = array($g->id); } else { $appgroups = $_SESSION['wizard']['appgroups']; } foreach ($usergroups as $usergroup) { foreach ($appgroups as $appgroup) { $exists = Abstract_Liaison::load('UsersGroupApplicationsGroup', $usergroup, $appgroup); if (is_object($exists) === false) { Abstract_Liaison::save('UsersGroupApplicationsGroup', $usergroup, $appgroup); } } } if (isset($_SESSION['wizard'])) { } unset($_SESSION['wizard']); redirect('publications.php'); die; }
function do_validate() { if ($_SESSION['wizard']['use_users'] == 'users') { if (!checkAuthorization('manageUsersGroups')) { redirect(); } $g = new UsersGroup(array('id' => NULL, 'name' => $_SESSION['wizard']['user_group_name'], 'description' => $_SESSION['wizard']['user_group_description'], 'published' => 1)); $res = $_SESSION['service']->users_group_add($g->getAttribute('name'), $g->getAttribute('description')); if (is_null($res)) { popup_error(_('Cannot create User Group')); } $g->id = $res; $g->setAttribute('id', $res); $users = $_SESSION['wizard']['users']; foreach ($users as $user) { $_SESSION['service']->users_group_add_user($user, $g->id); } $usergroups = array($g->id); } else { $usergroups = $_SESSION['wizard']['usergroups']; } if ($_SESSION['wizard']['use_apps'] == 'apps') { if (!checkAuthorization('manageApplicationsGroups')) { redirect(); } $g = new ApplicationsGroup(array('id' => NULL, 'name' => $_SESSION['wizard']['application_group_name'], 'description' => $_SESSION['wizard']['application_group_description'], 'published' => 1)); $res = $_SESSION['service']->applications_group_add($g->getAttribute('name'), $g->getAttribute('description')); if (!$res) { popup_error(_('Cannot create Application Group')); } $g->id = $res; $g->setAttribute('id', $res); $apps = $_SESSION['wizard']['apps']; foreach ($apps as $app) { $ret = $_SESSION['service']->applications_group_add_application($app, $g->id); } $appgroups = array($g->id); } else { $appgroups = $_SESSION['wizard']['appgroups']; } foreach ($usergroups as $usergroup) { foreach ($appgroups as $appgroup) { $_SESSION['service']->publication_add($usergroup, $appgroup); } } if (isset($_SESSION['wizard'])) { } unset($_SESSION['wizard']); redirect('publications.php'); die; }
* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(dirname(__FILE__)) . '/includes/core.inc.php'; require_once dirname(dirname(__FILE__)) . '/includes/page_template.php'; if (!checkAuthorization('viewUsersGroups')) { redirect('index.php'); } $schedules = array(3600 => _('1 hour'), 86400 => _('1 day'), 604800 => _('1 week')); if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == 'manage') { if (isset($_REQUEST['id'])) { show_manage($_REQUEST['id']); } } elseif ($_REQUEST['action'] == 'search') { show_default(); } redirect(); } if (!isset($_GET['view'])) { $_GET['view'] = 'all';
* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/includes/core.inc.php'; require_once dirname(__FILE__) . '/includes/page_template.php'; if (!checkAuthorization('viewPublications')) { redirect('index.php'); } show_default(); function show_default() { $applicationsGroupDB = ApplicationsGroupDB::getInstance(); $publications = array(); $groups_apps = $applicationsGroupDB->getList(true); if (is_null($groups_apps)) { $groups_apps = array(); } foreach ($groups_apps as $i => $group_apps) { if (!$group_apps->published) { unset($groups_apps[$i]); }
* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(dirname(__FILE__)) . '/includes/core.inc.php'; require_once dirname(dirname(__FILE__)) . '/includes/page_template.php'; if (!checkAuthorization('viewServers')) { redirect(); } if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == 'manage') { if (isset($_REQUEST['id'])) { show_manage($_REQUEST['id']); } } } show_default(); function show_manage($id) { $task = $_SESSION['service']->task_info($id); if (is_null($task)) { popup_error(sprintf(_('Unable to find task %s'), $id));
function net2ftp($action) { // -------------- // This function is the main net2ftp function; it is the interface between 3rd party // scripts (CMS, control panels, etc), and the internal net2ftp modules and plugins. // // This function is called 5 times per pageload: to send the HTTP headers, to print // the javascript code, to print the CSS code, to print the body onload actions and // finally to print the body content. // -------------- // ------------------------------------------------------------------------- // Check that "sendHttpHeaders" action is only executed once // Check that no other actions can be executed if "sendHttpHeaders" has not yet been executed // ------------------------------------------------------------------------- if ($action == "sendHttpHeaders") { if (defined("NET2FTP_SENDHTTPHEADERS") == true) { echo "Error: please call the net2ftp(\$action) function only once with \$action = \"sendHttpHeaders\"!"; return false; } else { define("NET2FTP_SENDHTTPHEADERS", 1); } } else { if (defined("NET2FTP_SENDHTTPHEADERS") == false) { echo "Error: please call the net2ftp(\$action) function first with \$action = \"sendHttpHeaders\"!"; return false; } } // ------------------------------------------------------------------------- // Global variables // ------------------------------------------------------------------------- global $net2ftp_settings, $net2ftp_globals, $net2ftp_result, $net2ftp_messages; // Set the NET2FTP constant which is used to check if template files are called by net2ftp if (defined("NET2FTP") == false) { define("NET2FTP", 1); } // Initialize the global variables if ($action == "sendHttpHeaders") { $net2ftp_globals = array(); $net2ftp_messages = array(); $net2ftp_output = array(); $net2ftp_result["success"] = true; $net2ftp_result["errormessage"] = ""; $net2ftp_result["debug_backtrace"] = ""; $net2ftp_result["exit"] = false; $net2ftp_settings = array(); } // ------------------------------------------------------------------------- // If an error occured during a previous execution of net2ftp(), return false // and let index.php print the error message // ------------------------------------------------------------------------- if ($net2ftp_result["success"] == false) { return false; } // ------------------------------------------------------------------------- // Input checks // ------------------------------------------------------------------------- if ($action != "sendHttpHeaders" && $action != "printJavascript" && $action != "printCss" && $action != "printBodyOnload" && $action != "printBody") { $net2ftp_result["success"] = false; $net2ftp_result["errormessage"] = "The \$action variable has an unknown value: {$action}."; $net2ftp_result["debug_backtrace"] = debug_backtrace(); logError(); return false; } // ------------------------------------------------------------------------- // Read settings files // ------------------------------------------------------------------------- if ($action == "sendHttpHeaders") { require NET2FTP_APPLICATION_ROOTDIR . "/settings.inc.php"; require NET2FTP_APPLICATION_ROOTDIR . "/settings_authorizations.inc.php"; require NET2FTP_APPLICATION_ROOTDIR . "/settings_screens.inc.php"; } // ------------------------------------------------------------------------- // Main directories // ------------------------------------------------------------------------- $net2ftp_globals["application_rootdir"] = NET2FTP_APPLICATION_ROOTDIR; if (NET2FTP_APPLICATION_ROOTDIR_URL == "/") { $net2ftp_globals["application_rootdir_url"] = ""; } else { $net2ftp_globals["application_rootdir_url"] = NET2FTP_APPLICATION_ROOTDIR_URL; } $net2ftp_globals["application_includesdir"] = $net2ftp_globals["application_rootdir"] . "/includes"; $net2ftp_globals["application_languagesdir"] = $net2ftp_globals["application_rootdir"] . "/languages"; $net2ftp_globals["application_modulesdir"] = $net2ftp_globals["application_rootdir"] . "/modules"; $net2ftp_globals["application_pluginsdir"] = $net2ftp_globals["application_rootdir"] . "/plugins"; $net2ftp_globals["application_skinsdir"] = $net2ftp_globals["application_rootdir"] . "/skins"; $net2ftp_globals["application_tempdir"] = $net2ftp_globals["application_rootdir"] . "/temp"; // ------------------------------------------------------------------------- // Set basic settings // ------------------------------------------------------------------------- if ($action == "sendHttpHeaders") { // Run the script to the end, even if the user hits the stop button ignore_user_abort(); // Execute function shutdown() if the script reaches the maximum execution time (usually 30 seconds) // DON'T REGISTER IT HERE YET, as this causes errors on newer versions of PHP; first include the function libraries // register_shutdown_function("net2ftp_shutdown"); // Set the error reporting level if ($net2ftp_settings["error_reporting"] == "ALL") { error_reporting(E_ALL); } elseif ($net2ftp_settings["error_reporting"] == "NONE") { error_reporting(0); } else { error_reporting(E_ERROR | E_WARNING | E_PARSE); } // Timer: start $net2ftp_globals["starttime"] = microtime(); $net2ftp_globals["endtime"] = microtime(); } // Set the PHP temporary directory // putenv("TMPDIR=" . $net2ftp_globals["application_tempdir"]); // ------------------------------------------------------------------------- // Function libraries: // 1. Libraries which are always needed // 2. Register global variables // 3. Function libraries which are needed depending on certain variables // // --> Do this only once, when $action == "sendHttpHeaders" // ------------------------------------------------------------------------- if ($action == "sendHttpHeaders") { // 1. Libraries which are always needed require_once $net2ftp_globals["application_includesdir"] . "/authorizations.inc.php"; require_once $net2ftp_globals["application_includesdir"] . "/consumption.inc.php"; require_once $net2ftp_globals["application_includesdir"] . "/database.inc.php"; require_once $net2ftp_globals["application_includesdir"] . "/errorhandling.inc.php"; require_once $net2ftp_globals["application_includesdir"] . "/filesystem.inc.php"; require_once $net2ftp_globals["application_includesdir"] . "/html.inc.php"; require_once $net2ftp_globals["application_includesdir"] . "/StonePhpSafeCrypt.php"; require_once $net2ftp_globals["application_languagesdir"] . "/languages.inc.php"; require_once $net2ftp_globals["application_skinsdir"] . "/skins.inc.php"; // 1. Define functions which are used, but which did not exist before PHP version 4.3.0 if (version_compare(phpversion(), "4.3.0", "<")) { require_once $net2ftp_globals["application_includesdir"] . "/before430.inc.php"; } // 2. Register global variables (POST, GET, GLOBAL, ...) require_once $net2ftp_globals["application_includesdir"] . "/registerglobals.inc.php"; // 3. Function libraries which are needed depending on certain variables if ($net2ftp_globals["state"] == "upload" || $net2ftp_globals["state"] == "unzip") { require_once $net2ftp_globals["application_includesdir"] . "/pclerror.lib.php"; require_once $net2ftp_globals["application_includesdir"] . "/pcltar.lib.php"; require_once $net2ftp_globals["application_includesdir"] . "/pcltrace.lib.php"; require_once $net2ftp_globals["application_includesdir"] . "/pclzip.lib.php"; } if ($net2ftp_globals["state"] == "advanced_ftpserver" || $net2ftp_globals["state"] == "advanced_parsing" || $net2ftp_globals["state"] == "advanced_webserver" || $net2ftp_globals["state"] == "browse" || $net2ftp_globals["state"] == "copymovedelete" || $net2ftp_globals["state"] == "chmod" || $net2ftp_globals["state"] == "calculatesize" || $net2ftp_globals["state"] == "downloadzip" || $net2ftp_globals["state"] == "findstring" || $net2ftp_globals["state"] == "followsymlink" || $net2ftp_globals["state"] == "install" || $net2ftp_globals["state"] == "zip") { require_once $net2ftp_globals["application_includesdir"] . "/browse.inc.php"; } if ($net2ftp_globals["state"] == "downloadzip" || $net2ftp_globals["state"] == "zip") { require_once $net2ftp_globals["application_includesdir"] . "/zip.lib.php"; } // 4. Load the plugins require_once $net2ftp_globals["application_pluginsdir"] . "/plugins.inc.php"; $net2ftp_globals["activePlugins"] = getActivePlugins(); net2ftp_plugin_includePhpFiles(); // 5. Load the language file includeLanguageFile(); } // ------------------------------------------------------------------------- // Execute function shutdown() if the script reaches the maximum execution time (usually 30 seconds) // ------------------------------------------------------------------------- if ($action == "sendHttpHeaders") { register_shutdown_function("net2ftp_shutdown"); } // ------------------------------------------------------------------------- // Log access // --> Do this only once, when $action == "sendHttpHeaders" // ------------------------------------------------------------------------- if ($action == "sendHttpHeaders") { logAccess(); if ($net2ftp_result["success"] == false) { logError(); return false; } } // ------------------------------------------------------------------------- // Check authorizations // --> Do this only once, when $action == "sendHttpHeaders" // ------------------------------------------------------------------------- if ($action == "sendHttpHeaders" && $net2ftp_settings["check_authorization"] == "yes" && $net2ftp_globals["ftpserver"] != "") { checkAuthorization($net2ftp_globals["ftpserver"], $net2ftp_globals["ftpserverport"], $net2ftp_globals["directory"], $net2ftp_globals["username"]); if ($net2ftp_result["success"] == false) { logError(); return false; } } // ------------------------------------------------------------------------- // Get the consumption counter values from the database // This retrieves the consumption of network and server resources for the // current IP address and FTP server from the database, and stores these // values in global variables. See /includes/consumption.inc.php for the details. // --> Do this only once, when $action == "sendHttpHeaders" // ------------------------------------------------------------------------- if ($action == "sendHttpHeaders") { getConsumption(); if ($net2ftp_result["success"] == false) { logError(); return false; } } // ------------------------------------------------------------------------- // Execute the action! // ------------------------------------------------------------------------- // ------------------------------------ // For most modules, everything must be done: send headers, print body, etc // ------------------------------------ if ($net2ftp_globals["state"] == "admin" || $net2ftp_globals["state"] == "admin_createtables" || $net2ftp_globals["state"] == "admin_emptylogs" || $net2ftp_globals["state"] == "admin_viewlogs" || $net2ftp_globals["state"] == "advanced" || $net2ftp_globals["state"] == "advanced_ftpserver" || $net2ftp_globals["state"] == "advanced_parsing" || $net2ftp_globals["state"] == "advanced_webserver" || $net2ftp_globals["state"] == "bookmark" || $net2ftp_globals["state"] == "browse" || $net2ftp_globals["state"] == "calculatesize" || $net2ftp_globals["state"] == "chmod" || $net2ftp_globals["state"] == "copymovedelete" || $net2ftp_globals["state"] == "edit" || $net2ftp_globals["state"] == "findstring" || $net2ftp_globals["state"] == "install" || $net2ftp_globals["state"] == "jupload" && $net2ftp_globals["screen"] == 1 || $net2ftp_globals["state"] == "login" || $net2ftp_globals["state"] == "login_small" || $net2ftp_globals["state"] == "logout" || $net2ftp_globals["state"] == "newdir" || $net2ftp_globals["state"] == "raw" || $net2ftp_globals["state"] == "rename" || $net2ftp_globals["state"] == "unzip" || $net2ftp_globals["state"] == "upload" || $net2ftp_globals["state"] == "view" && $net2ftp_globals["state2"] == "" || $net2ftp_globals["state"] == "zip") { require_once $net2ftp_globals["application_modulesdir"] . "/" . $net2ftp_globals["state"] . "/" . $net2ftp_globals["state"] . ".inc.php"; if ($action == "sendHttpHeaders") { net2ftp_module_sendHttpHeaders(); // If needed, exit to avoid sending non-header output (by net2ftp or other application) // Example: if a module sends a HTTP redirect header (See /includes/authorizations.inc.php function checkAdminUsernamePassword()!) if ($net2ftp_result["exit"] == true) { exit; } } elseif ($action == "printJavascript") { net2ftp_module_printJavascript(); net2ftp_plugin_printJavascript(); } elseif ($action == "printCss") { net2ftp_module_printCss(); net2ftp_plugin_printCss(); } elseif ($action == "printBodyOnload") { net2ftp_module_printBodyOnload(); net2ftp_plugin_printBodyOnload(); } elseif ($action == "printBody") { // Print the status bar to be able to show the progress if (isStatusbarActive() == true) { require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/statusbar.template.php"; } require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/status/status.inc.php"; // Do the work and meanwhile update the progress bar net2ftp_module_printBody(); // Update the consumption statistics $net2ftp_globals["endtime"] = microtime(); $net2ftp_globals["time_taken"] = timer(); addConsumption(0, $net2ftp_globals["time_taken"]); putConsumption(); // Set the progress bar to "finished" if (isStatusbarActive() == true) { $statusmessage = __("Script finished in %1\$s seconds", $net2ftp_globals["time_taken"]); setStatus(1, 1, $statusmessage); } } } elseif ($net2ftp_globals["state"] == "clearcookies" || $net2ftp_globals["state"] == "downloadfile" || $net2ftp_globals["state"] == "downloadzip" || $net2ftp_globals["state"] == "followsymlink" || $net2ftp_globals["state"] == "jupload" && $net2ftp_globals["screen"] == 2 || $net2ftp_globals["state"] == "view" && $net2ftp_globals["state2"] != "") { require_once $net2ftp_globals["application_modulesdir"] . "/" . $net2ftp_globals["state"] . "/" . $net2ftp_globals["state"] . ".inc.php"; if ($action == "sendHttpHeaders") { // Do the work - do not update the progress bar net2ftp_module_sendHttpHeaders(); // Update the consumption statistics $net2ftp_globals["endtime"] = microtime(); $net2ftp_globals["time_taken"] = timer(); addConsumption(0, $net2ftp_globals["time_taken"]); putConsumption(); // Exit to avoid sending non-header output (by net2ftp or other application) exit; } elseif ($action == "printJavascript") { } elseif ($action == "printCss") { } elseif ($action == "printBodyOnload") { } elseif ($action == "printBody") { } } elseif ($net2ftp_globals["state"] == "error") { logError(); return false; } else { $errormessage = __("Unexpected state string: %1\$s. Exiting.", $net2ftp_globals["state"]); setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__); logError(); return false; } }
/** * Checks a logon user/password against the list of admins * * Returns true if there is a match * * @param string $user * @param string $pass * @return bool */ function checkLogon($user, $pass) { $admins = getAdministrators(); foreach ($admins as $admin) { if ($admin['user'] == $user) { $md5 = passwordHash($user, $pass); if ($admin['pass'] == $md5) { return checkAuthorization($md5); } } } return false; }