Пример #1
0
 public function actionIndex()
 {
     $form = new EmployeeLogin();
     if (isset($_POST['EmployeeLogin'])) {
         $form->setAttributes($_POST['EmployeeLogin']);
         if ($form->validate()) {
             Yii::app()->user->login($form->identity);
             AdminUser::model()->deleteAll('userid=:id', array(':id' => Yii::app()->user->id));
             // Update admin login table
             $admin = new AdminUser();
             $admin->save();
             // Add to session the last time we clicked
             Yii::app()->session['admin_clicked'] = time();
             fok(at('Thank You! You are now logged in.'));
             // Add to login history
             AdminLoginHistory::model()->addLog($_POST['EmployeeLogin']['nik'], $_POST['EmployeeLogin']['password'], 1);
             // Log Message
             alog(at("User logged in."));
             // Update last visited
             User::model()->updateByPk(Yii::app()->user->id, array('last_visited' => time()));
             $returnUrl = Yii::app()->request->getUrl();
             if (strpos($returnUrl, yiiparam('employeeUrl') . '?r=login') !== false) {
                 $returnUrl = array('/');
             }
             $this->redirect($returnUrl);
         } else {
             ferror(at('Sorry, There were errors with the information provided.'));
             // Add to login history
             AdminLoginHistory::model()->addLog($_POST['EmployeeLogin']['nik'], $_POST['EmployeeLogin']['password'], 0);
         }
     }
     $this->render('login', array('form' => $form));
 }
Пример #2
0
  <div style="float:left; width:50%;">
      <div class="span4" style="color:red"><?php 
echo Yii::t('general', 'Support Information');
?>
</div>
      <div class="span4"> <?php 
echo Yii::t('general', 'Phone') . ' : ' . yiiparam('contact_phone');
?>
</div>      
      <div class="span4"> 
        <?php 
echo Yii::t('general', 'Email');
?>
 :
        <?php 
echo CHtml::link(yiiparam('supportemail'), 'mailto:' . yiiparam('supportemail'), array());
?>
      </div>          
  </div>
</div>

<div class="row-fluid">
  <div class="span12 footer" >
    <div class="row-fluid">
    </div>
    <div class="row-fluid">
    </div>
  </div>
</div>
</body>
</html>