示例#1
0
             $create_new_station = TRUE;
         }
     } else {
         $create_new_station = TRUE;
     }
     if ($create_new_station == TRUE) {
         //Insert new station
         $sf = new StationFactory();
         $sf->setCompany($current_company->getId());
         $sf->setStatus('ENABLED');
         $sf->setType('PC');
         $sf->setSource($_SERVER['REMOTE_ADDR']);
         $sf->setStation();
         $sf->setDescription(substr($_SERVER['HTTP_USER_AGENT'], 0, 250));
         if ($sf->Save(FALSE)) {
             $sf->setCookie();
         }
     }
     Redirect::Page(URLBuilder::getURL(NULL, 'index.php'));
 } else {
     $error_message = TTi18n::gettext('User Name or Password is incorrect');
     //Get company status from user_name, so we can display messages for ONHOLD/Cancelled accounts.
     $clf = new CompanyListFactory();
     $clf->getByUserName($user_name);
     if ($clf->getRecordCount() > 0) {
         $c_obj = $clf->getCurrent();
         if ($c_obj->getStatus() == 20) {
             $error_message = TTi18n::gettext('Sorry, your company\'s account has been placed ON HOLD, please contact customer support immediately');
         } elseif ($c_obj->getStatus() == 30) {
             $error_message = TTi18n::gettext('Sorry, your company\'s account has been CANCELLED, please contact customer support if you believe this is an error');
         }