public function findModel()
 {
     if (empty(Session::getSession()->id)) {
         throw new Exception("Não pode ser vazio!", 404);
     }
     return Usuario::find(Session::getSession()->id);
 }
Пример #2
0
 public static function rule()
 {
     if (empty(Session::getSession()->id)) {
         Session::clear();
         header('Location:/painel/');
         exit;
     } else {
         return true;
     }
 }
 public function actionIndex()
 {
     if (empty(Session::getSession()->nome)) {
         $this->layout = 'login';
         $this->render('login', ['model' => new Usuario()]);
     } else {
         $post = new Post();
         $post->usuario_id = Session::getSession()->id;
         return $this->render('index', ['usuarios' => Usuario::count(), 'post' => $post]);
     }
 }
Пример #4
0
         <img src="<?php 
echo $this->createUrl() . '/app/assets/arquivos/profile/' . Kanda::$app->session->getSession()->photo;
?>
"  />

       </div>

      </div><!-- /.tab-pane -->
    </div><!-- /.tab-content -->
  </div><!-- nav-tabs-custom -->
</div><!-- /.box-body -->
<div class="box-footer">              
</div><!-- /.box-footer-->
</div>
<?php 
Session::clear('class');
?>
<script src="<?php 
echo $this->createUrl();
?>
/app/vendors/fileupload/js/vendor/jquery.ui.widget.js" ></script>
<script src="<?php 
echo $this->createUrl();
?>
/app/vendors/fileupload/js/jquery.iframe-transport.js" ></script>
<script src="<?php 
echo $this->createUrl();
?>
/app/vendors/fileupload/js/jquery.fileupload.js" ></script>

<script>
 /**
  * 
  * @param type $objct
  * 
  */
 public function setSession($objct)
 {
     Session::setSession(['nome' => $objct->nome, 'login' => $objct->login, 'id' => $objct->id, 'file' => '/', 'email' => $objct->email, 'photo' => $objct->file]);
     //$_SESSION['idLog']     =  $idLog;
     parent::Json(['msg' => 'Aguarde...', 'success' => 1, 'class' => 'success', 'page' => $this->createUrl('painel'), 'file' => $this->createUrl() . '/app/assets/arquivos/profile/' . $objct->file]);
 }
 public function actionIndex()
 {
     return $this->render('index', ['usuario_id' => Session::getSession()->id]);
 }
Пример #7
0
 public function __construct()
 {
     Kanda::$post = \core\helps\Http::run();
     Kanda::$app = (object) ['arrays' => \core\helps\Arrays::run(), 'cache' => \core\helps\Cache::run(), 'crop' => \core\helps\Crop::run(), 'html' => \core\helps\Html::run(), 'url' => \core\helps\Url::run(), 'uploadFile' => \core\helps\UploadFile::run(), 'session' => \core\helps\Session::run()];
 }