// If exist load library functions and template lib module if (@file_exists($module['file']['language'])) { require $module['file']['language']; } if (@file_exists($module['file']['library'])) { require $module['file']['library']; } if (@file_exists($module['file']['template'])) { require $module['file']['template']; } // Create unique template, library and language dictionary $language = isset($module['language']) ? array_merge($console['language'], $module['language']) : $console['language']; $tpl = isset($module['template']) ? array_merge($console['template'], $module['template']) : $console['template']; // Load module config $module['config']['module']['@']['defaction'] = 'main'; if (sumo_verify_file($module['file']['config'])) { $module['config'] = sumo_xmlize(file_get_contents($module['file']['config'])); } // Get action from user session // if not exist try to get it from module.xml $action = $_SESSION['action'] ? $_SESSION['action'] : $module['config']['module']['@']['defaction']; $_SESSION['action'] = $action; // Create Menu' tabs $menus = $module['config']['module']['#']['menu']; for ($m = 0; $m < sizeof($menus); $m++) { $menu_name = $menus[$m]['@']['name'] ? $menus[$m]['@']['name'] : $action; $tabs = $menus[$m]['#']['tab']; if ($tabs) { for ($l = 0; $l < sizeof($tabs); $l++) { $menu_query = isset($tabs[$l]['@']['query']) ? $tabs[$l]['@']['query'] : ""; $menu_module = isset($tabs[$l]['@']['module']) ? $tabs[$l]['@']['module'] : "";
// Set variables if (!isset($_GET['module'])) { $_GET['module'] = ''; } if (!isset($_GET['action'])) { $_GET['action'] = ''; } $_SESSION['module'] = in_array($_GET['module'], $modules) ? $_GET['module'] : false; $_SESSION['action'] = ereg('^[_a-z0-9]{3,32}$', $_GET['action']) ? $_GET['action'] : false; // $console['file'] = array('language' => SUMO_PATH . '/languages/' . $_COOKIE['language'] . '/lang.console.php', 'language_ext' => SUMO_PATH . '/languages/' . $_COOKIE['language'] . '/lang.console.' . $SUMO['page']['theme'] . '.php', 'template' => SUMO_PATH . '/themes/' . $SUMO['page']['theme'] . '/message.tpl', 'library_ext' => SUMO_PATH . '/libs/lib.console.' . $SUMO['page']['theme'] . '.php', 'tpl_library' => SUMO_PATH . '/libs/lib.template.console.php', 'tpl_library_ext' => SUMO_PATH . '/libs/lib.template.console.' . $SUMO['page']['theme'] . '.php'); // Load console language & template libraries if (sumo_verify_file($console['file']['language'])) { require $console['file']['language']; } if (sumo_verify_file($console['file']['tpl_library'])) { require $console['file']['tpl_library']; } // Load optional libraries if (file_exists($console['file']['library_ext'])) { require $console['file']['library_ext']; } if (file_exists($console['file']['language_ext'])) { require $console['file']['language_ext']; } if (file_exists($console['file']['tpl_library_ext'])) { require $console['file']['tpl_library_ext']; } if ($_SESSION['module']) { require SUMO_PATH . '/module.php'; } else {
*/ $tab = sumo_get_user_info($_GET['id'], 'id', FALSE); if (sumo_verify_permissions(4, $tab['group'])) { if ($SUMO['user']['id'] == $_GET['id'] || $SUMO['user']['user'] == 'sumo') { $validate[0] = ''; // If id not exist if (!$tab['id']) { $tpl['MESSAGE:H'] = sumo_get_message('W00001C', $_GET['id']); } else { sumo_delete_user_image($_GET['id']); } if ($validate[0]) { $tpl['MESSAGE:M'] = $validate[1]; } $tpl['GET:UpdateForm'] = "<form action='?module=users&action=editimg&id=" . $tab['id'] . "' " . "name='UpdateUserImg' method='POST' enctype='multipart/form-data'>"; $tpl['IMG:User'] = "******" . $tab['id'] . "' alt='" . $tab['username'] . "' class='user'>"; $tpl['PUT:UserImage'] = "<input type='hidden' name='MAX_FILE_SIZE' value='30720'>" . "<input type='file' size='20' class='file' name='user_image' >"; $tpl['GET:DeleteForm'] = "<form action='?module=users&action=deleteimg&id=" . $tab['id'] . "' name='DeleteUserImg' method='POST'>\n" . "<input type='submit' class='button' value='" . $language['Delete'] . "'>\n" . "</form>"; // Note: not using sumo_show_window() function // because for this event a window is external $tpl_file = SUMO_PATH_MODULE . '/templates/editimg.tpl'; if (sumo_verify_file($tpl_file)) { $content = implode('', file($tpl_file)); } echo sumo_process_template($content, $tpl); exit; } } else { $action_error = true; $tpl['MESSAGE:H'] = $language['AccessDenied']; }
$ds = 'mysql_users'; break; case 'Postgres': $ds = 'postgres'; break; case 'Oracle': $ds = 'oracle'; break; case 'GMail': $ds = 'gmail'; break; case 'Joomla15': $ds = 'joomla15'; break; default: exit("W09002X"); break; } $ds_file = SUMO_PATH . '/libs/lib.datasource.' . $ds . '.php'; if (sumo_verify_file($ds_file)) { require $ds_file; } $status = $sumo_verify_datasource_connection($id) ? 1 : 0; echo $status; break; // Unknow command // Unknow command default: echo "E00121X"; break; }
if (!defined('SUMO_PATH')) { $err = 'E00001S'; } // Display startup error then exit if ($err) { require 'inc/inc.startup_errors.php'; } // save and exit from app. switch ($_SESSION['action']) { case 'logout': header("Location: " . $SUMO['page']['url'] . "?sumo_action=logout"); break; } $desktop['file']['template'] = SUMO_PATH . '/themes/' . $SUMO['page']['theme'] . '/desktop.tpl'; // if template destop not exist display error then exit if (!sumo_verify_file($desktop['file']['template'])) { $err = 'E00004S'; require SUMO_PATH . '/inc/inc.startup_errors.php'; } // Desktop $desktop['template'] = implode('', file($desktop['file']['template'])); $desktop['settings'] = sumo_get_console_settings(); $tpl = $console['template']; $tpl['GET:Flags'] = sumo_get_flags(); $tpl['GET:ModulesWindows'] = "<!-- WINDOWS -->\n"; /** * Define windows for all modules */ $num_modules = count($modules); for ($m = 0; $m < $num_modules; $m++) { $m_name = $modules[$m];
* SUMO: Load required core language file * * @version 0.3.5 * @link http://sumoam.sourceforge.net SUMO Access Manager * @author Alberto Basso <*****@*****.**> * @copyright Copyright © 2003-2009, Alberto Basso * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @package SUMO * @category Core */ if (!empty($_REQUEST['sumo_lang']) || !$_COOKIE['language']) { $available_lang = sumo_get_available_languages(); // try to detect browser language... $detected_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); $default_lang = in_array($detected_lang, $available_lang) ? $detected_lang : $SUMO['config']['server']['language']; $language = in_array($_REQUEST['sumo_lang'], $available_lang) ? $_REQUEST['sumo_lang'] : $default_lang; setcookie('language', $language, $SUMO['server']['time'] + 5184000); // 60gg // ...because cookie need time to write ;) $_COOKIE['language'] = $language; } // Load core language file $lang_core = SUMO_PATH . "/languages/" . $SUMO['config']['server']['language'] . "/lang.core.php"; $lang_login = SUMO_PATH . "/languages/" . $_COOKIE['language'] . "/lang.login.php"; if (sumo_verify_file($lang_core)) { require $lang_core; } if (sumo_verify_file($lang_login)) { require $lang_login; } $sumo_lang_core = array_merge($sumo_lang_core, $sumo_lang_login);