예제 #1
0
<?php

use Scabbia\Extensions\Session\Session;
if (($notification = Session::getFlash('notification')) !== null) {
    ?>
    <div class="alert alert-<?php 
    echo $notification[0];
    ?>
">
        <i class="icon-<?php 
    echo $notification[1];
    ?>
"></i> <?php 
    echo implode('<br />', (array) $notification[2]);
    ?>
    </div>
<?php 
}
예제 #2
0
 /**
  * @ignore
  */
 public static function check($uCode, $uCookieName = 'captcha')
 {
     // check the supplied code
     $tResult = Session::getFlash($uCookieName, "") === strtolower($uCode);
     // return the result
     return $tResult;
 }
예제 #3
0
 /**
  * @ignore
  */
 public static function remove($uAction, $uSlug)
 {
     Auth::checkRedirect('editor');
     Session::set('notification', array('info', 'ok-sign', 'Category removed.'));
     Http::redirect('panel/categories');
 }
예제 #4
0
 /**
  * @ignore
  */
 public function login()
 {
     if (Request::$method !== 'post') {
         Auth::clear();
         $this->viewFile('{core}views/panel/login.php');
         return;
     }
     // validations
     Validation::addRule('username')->isRequired()->errorMessage('Username shouldn\'t be blank.');
     // Validation::addRule('username')->isEmail()->errorMessage('Please consider your e-mail address once again.');
     Validation::addRule('password')->isRequired()->errorMessage('Password shouldn\'t be blank.');
     Validation::addRule('password')->lengthMinimum(4)->errorMessage('Password should be longer than 4 characters at least.');
     if (!Validation::validate($_POST)) {
         Session::set('notification', array('error', 'remove-sign', Validation::getErrorMessages(true)));
         $this->viewFile('{core}views/panel/login.php');
         return;
     }
     $username = Request::post('username');
     $password = Request::post('password');
     // user not found
     if (!Auth::login($username, $password)) {
         Session::set('notification', array('error', 'remove-sign', 'User not found'));
         $this->viewFile('{core}views/panel/login.php');
         return;
     }
     Http::redirect('panel');
 }
예제 #5
0
 /**
  * Clears logged user information
  */
 public static function clear()
 {
     self::load();
     Session::remove(self::$sessionKey);
 }
예제 #6
0
파일: Fb.php 프로젝트: eserozvataf/scabbia1
 /**
  * @ignore
  */
 public static function get($uQuery, $uUseCache = false, $uExtra = null)
 {
     if (self::$userId === self::NO_USER_ID) {
         return false;
     }
     if ($uExtra === null) {
         $uExtra = array();
     }
     if ($uUseCache && isset(self::$facebookData['cache'][$uQuery])) {
         $tObject = self::$facebookData['cache'][$uQuery];
     } else {
         try {
             $tObject = self::$api->api($uQuery, $uExtra);
             self::$facebookData['cache'][$uQuery] = $tObject;
             Session::set('facebookData', self::$facebookData);
         } catch (\FacebookApiException $tException) {
             return false;
         }
     }
     return new FacebookQueryObject($tObject);
 }