header('Content-Type: text/html; charset=UTF-8'); } $permission = new Permission(); $authentication = new Authentication(); if (isset($authenticate) and $authenticate === FALSE) { Debug::text('Bypassing Authentication', __FILE__, __LINE__, __METHOD__, 10); TTi18n::chooseBestLocale(); } else { //Increase timeout on WAP devices, so they don't have to login as often. if (isset($enable_wap) and $enable_wap == TRUE) { $authentication->setIdle(32400); //9hrs } elseif (isset($config_vars['other']['web_session_timeout']) and $config_vars['other']['web_session_timeout'] != '') { $authentication->setIdle((int) $config_vars['other']['web_session_timeout']); } if ($authentication->Check() === TRUE) { /* * Get default interface data here. Things like User info, Company info etc... */ $current_user = $authentication->getObject(); Debug::text('User Authenticated: ' . $current_user->getUserName() . ' Created Date: ' . $authentication->getCreatedDate(), __FILE__, __LINE__, __METHOD__, 10); $clf = new CompanyListFactory(); $current_company = $clf->getByID($current_user->getCompany())->getCurrent(); unset($clf); //Check to make sure the logged in user's information is all up to date. //Make sure they also have permissions to edit information, otherwise don't redirect them. if ($current_user->isInformationComplete() == FALSE and (!stristr($_SERVER['SCRIPT_NAME'], 'permissiondenied') and !stristr($_SERVER['SCRIPT_NAME'], 'logout') and !stristr($_SERVER['SCRIPT_NAME'], 'about') and !stristr($_SERVER['SCRIPT_NAME'], 'punch.php') and !stristr($_SERVER['SCRIPT_NAME'], 'ajax_server') and !stristr($_SERVER['SCRIPT_NAME'], 'global.js') and !stristr($_SERVER['SCRIPT_NAME'], 'menu.js') and !stristr($_SERVER['SCRIPT_NAME'], 'embeddeddocument')) and !isset($_GET['incomplete']) and !isset($_POST['incomplete']) and ($permission->Check('user', 'enabled') and ($permission->Check('user', 'edit') or $permission->Check('user', 'edit_own') or $permission->Check('user', 'edit_child')))) { Redirect::Page(URLBuilder::getURL(array('id' => $current_user->getID(), 'incomplete' => 1), Environment::GetBaseURL() . 'users/EditUser.php')); } $db_time_zone_error = FALSE; $current_user_prefs = $current_user->getUserPreferenceObject();
* the words "Powered by TimeTrex". ********************************************************************************/ /* * $Revision: 8160 $ * $Id: server.php 8160 2006-05-31 23:33:54Z root $ * $Date: 2006-05-31 16:33:54 -0700 (Wed, 31 May 2006) $ */ //Don't force SSL for SOAP clients. $disable_https = TRUE; require_once '../includes/global.inc.php'; Debug::setEnable(TRUE); Debug::setEnableDisplay(FALSE); Debug::setEnableLog(TRUE); Debug::setEnableTidy(FALSE); Debug::setVerbosity(10); if (isset($_GET['SessionID']) and $_GET['SessionID'] != '') { $authentication = new Authentication(); if ($authentication->Check($_GET['SessionID']) === TRUE) { $server = new SoapServer(null, array('uri' => "urn:test")); $server->setClass('TimeTrexSoapServer'); $server->handle(); } else { echo "User not authenticated!<br>\n"; exit; } } else { $server = new SoapServer(null, array('uri' => "urn:test")); $server->setClass('TimeTrexSoapServerUnAuthenticated'); $server->handle(); } Debug::writeToLog();
function isLoggedIn($touch_updated_date = TRUE) { global $authentication, $config_vars; $session_id = getSessionID(); if ($session_id != '') { $authentication = new Authentication(); Debug::text('AMF Session ID: ' . $session_id . ' Source IP: ' . $_SERVER['REMOTE_ADDR'], __FILE__, __LINE__, __METHOD__, 10); if (isset($config_vars['other']['web_session_timeout']) and $config_vars['other']['web_session_timeout'] != '') { $authentication->setIdle((int) $config_vars['other']['web_session_timeout']); } if ($authentication->Check($session_id, $touch_updated_date) === TRUE) { return TRUE; } } return FALSE; }
/** * Private: Setup Variables * * @return void */ private static function Setup() { if (CTM_ROOT_AREA == "public") { $template = CTM_Command::instance()->output->template; $publicDir = PUBLIC_DIRECTORY . "/%s/" . $template . "/"; CTM_Command::instance()->updateVars("public_directory", PUBLIC_DIRECTORY . "/"); CTM_Command::instance()->updateVars("admincp_directory", ADMINCP_DIRECTORY . "/"); CTM_Command::instance()->updateVars("style_dirs,skin_styles", sprintf($publicDir, "style_css")); CTM_Command::instance()->updateVars("style_dirs,skin_images", sprintf($publicDir, "style_images")); CTM_Command::instance()->updateVars("style_dirs,skin_res", sprintf($publicDir, "style_resources")); CTM_Command::instance()->updateVars("style_dirs,styles", PUBLIC_DIRECTORY . "/style_css/"); CTM_Command::instance()->updateVars("style_dirs,images", PUBLIC_DIRECTORY . "/images/"); CTM_Command::instance()->updateVars("style_dirs,js", PUBLIC_DIRECTORY . "/javascripts/"); CTM_Command::instance()->updateVars("board_host", CTM_URLEngine::URLHost()); CTM_Command::instance()->updateVars("board_url", CTM_URLEngine::URLBase()); CTM_Command::instance()->updateVars("path_url", CTM_URLEngine::URIString()); CTM_Command::instance()->updateVars("language_js", EffectWebData::LANGUAGE_JS . CTM_Command::instance()->lang->language); define("SESSION_USER_LOGGED", Authentication::Check()); } }
{ $this->server->exec(); } } //APIAuthentication->isLoggedIn() checks for active session or not as well. $session_id = getSessionID(); //Debug::Arr($_COOKIE,' API Cookies: ', __FILE__, __LINE__, __METHOD__, 10); //Debug::Arr($_POST,' API POST: ', __FILE__, __LINE__, __METHOD__, 10); if ($session_id != '' and !isset($_GET['session'])) { //When Flex calls PING() on a regular basis it will send Session=0, so always skip authentication checks for this. $authentication = new Authentication(); Debug::text('AMF Session ID: ' . $session_id . ' Source IP: ' . $_SERVER['REMOTE_ADDR'], __FILE__, __LINE__, __METHOD__, 10); if (isset($config_vars['other']['web_session_timeout']) and $config_vars['other']['web_session_timeout'] != '') { $authentication->setIdle((int) $config_vars['other']['web_session_timeout']); } if ($authentication->Check($session_id) === TRUE) { $current_user = $authentication->getObject(); if (is_object($current_user)) { $current_user->getUserPreferenceObject()->setDateTimePreferences(); $current_user_prefs = $current_user->getUserPreferenceObject(); Debug::text('Locale Cookie: ' . TTi18n::getLocaleCookie(), __FILE__, __LINE__, __METHOD__, 10); if (TTi18n::getLocaleCookie() != '' and $current_user_prefs->getLanguage() !== TTi18n::getLanguageFromLocale(TTi18n::getLocaleCookie())) { Debug::text('Changing User Preference Language to match cookie...', __FILE__, __LINE__, __METHOD__, 10); $current_user_prefs->setLanguage(TTi18n::getLanguageFromLocale(TTi18n::getLocaleCookie())); if ($current_user_prefs->isValid()) { $current_user_prefs->Save(FALSE); } } else { Debug::text('User Preference Language matches cookie!', __FILE__, __LINE__, __METHOD__, 10); } if (isset($_GET['language']) and $_GET['language'] != '') {