Ejemplo n.º 1
0
$action = Misc::findSubmitButton();
switch ($action) {
    case 'submit':
        //Debug::setVerbosity( 11 );
        Debug::Text('User Name: ' . $user_name, __FILE__, __LINE__, __METHOD__, 10);
        if (isset($config_vars['other']['web_session_expire']) and $config_vars['other']['web_session_expire'] != '') {
            $authentication->setEnableExpireSession((int) $config_vars['other']['web_session_expire']);
        }
        $authentication_result = $authentication->Login($user_name, $password);
        if ($authentication_result === TRUE) {
            $authentication->Check();
            Debug::text('Login Language: ' . $language, __FILE__, __LINE__, __METHOD__, 10);
            TTi18n::setCountry(TTi18n::getCountryFromLocale());
            TTi18n::setLanguage($language);
            TTi18n::setLocale();
            TTi18n::setLocaleCookie();
            Debug::text('Locale: ' . TTi18n::getLocale(), __FILE__, __LINE__, __METHOD__, 10);
            $clf = TTnew('CompanyListFactory');
            $clf->getByID($authentication->getObject()->getCompany());
            $current_company = $clf->getCurrent();
            unset($clf);
            $create_new_station = FALSE;
            //If this is a new station, insert it now.
            if (isset($_COOKIE['StationID'])) {
                Debug::text('Station ID Cookie found! ' . $_COOKIE['StationID'], __FILE__, __LINE__, __METHOD__, 10);
                $slf = TTnew('StationListFactory');
                $slf->getByStationIdandCompanyId($_COOKIE['StationID'], $current_company->getId());
                $current_station = $slf->getCurrent();
                unset($slf);
                if ($current_station->isNew()) {
                    Debug::text('Station ID is NOT IN DB!! ' . $_COOKIE['StationID'], __FILE__, __LINE__, __METHOD__, 10);
Ejemplo n.º 2
0
         $upf->setEnableEmailNotificationException(FALSE);
     }
     if (isset($pref_data['enable_email_notification_message'])) {
         $upf->setEnableEmailNotificationMessage(TRUE);
     } else {
         $upf->setEnableEmailNotificationMessage(FALSE);
     }
     if (isset($pref_data['enable_email_notification_home'])) {
         $upf->setEnableEmailNotificationHome(TRUE);
     } else {
         $upf->setEnableEmailNotificationHome(FALSE);
     }
     if ($upf->isValid()) {
         $upf->Save(FALSE);
         if ($current_user->getId() == $upf->getUser()) {
             TTi18n::setLocaleCookie($pref_data['language'] . '_' . $current_user->getCountry());
         }
         Redirect::Page(URLBuilder::getURL(array('user_id' => $pref_data['user_id'], 'data_saved' => 1), Environment::getBaseURL() . '/users/EditUserPreference.php'));
         unset($upf);
         break;
     }
 default:
     if (!isset($user_id) or isset($user_id) and $user_id == '') {
         $user_id = $current_user->getId();
     }
     $ulf->getByIdAndCompanyId($user_id, $current_company->getId());
     if ($ulf->getRecordCount() > 0) {
         $user_obj = $ulf->getCurrent();
     }
     if (!isset($action)) {
         BreadCrumb::setCrumb($title);