Exemplo n.º 1
0
 static function init()
 {
     if (is_null(self::$instance)) {
         self::$instance = new Redirection();
     }
     return self::$instance;
 }
Exemplo n.º 2
0
 public function destroy($id)
 {
     if ($this->consult->getConsultar("\n            DELETE FROM user\n            WHERE id_user = '******'\n        ")) {
         Cookies::set("delete", "Se ha eliminado el usuario correctamente", "20-s");
         Redirection::go("user");
     } else {
         Cookies::set("alert", "Error: No se ha podido eliminar el usuario intenta de nuevo", "20-s");
         Redirection::go("user");
     }
 }
 protected function _handleRedirection()
 {
     if ($this->_redirection !== null) {
         if ($this->navpoint !== null && $this->navpoint !== '') {
             $navigator = new Project_Navigator();
             $to = $navigator->get($this->navpoint);
         } else {
             $to = $this->target;
         }
         if ($this->qs !== null) {
             if ($this->qs[0] !== '?') {
                 $to .= '?';
             }
             $to .= $this->qs;
         }
         Redirection::redirectPage($to, $this->code, $this->schema, $this->host);
     }
 }
Exemplo n.º 4
0
 protected function _handleRedirection()
 {
     if ($this->_redirection !== null) {
         Redirection::redirectNavPoint($this->_redirection);
     }
 }
Exemplo n.º 5
0
<?php

require "../classes/classCheckId.php";
require "../classes/redirection.php";
$login = $_POST['nom'];
$password = $_POST['password'];
if (isset($login) && isset($password)) {
    $connexionUser = new CheckId($login, $password);
    if ($connexionUser->checkId() === false) {
        echo $connexionUser->errorId;
    } else {
        session_start();
        $_SESSION['iduser'] = $connexionUser->checkId()['id'];
        if ($connexionUser->checkId()['autorisation'] === "1") {
            $redirectionSadmin = new Redirection('../Admin/admin.php');
            $redirectionSadmin->redirect();
        } else {
            if ($connexionUser->checkId()['init'] === "1") {
                $redirectionHome = new Redirection("../siteform.php");
                $redirectionHome->redirect();
            } else {
                $redirectionChangePW = new Redirection("../premiereConnexion.php");
                $redirectionChangePW->redirect();
            }
        }
    }
}
Exemplo n.º 6
0
 public static function redirectPage($to, $code = 303, $schema = null, $host = null)
 {
     $ro = new Redirection($to, $code, $schema, $host);
     $ro->redirect();
 }
Exemplo n.º 7
0
 function __construct()
 {
     parent::__construct('403-Forbidden');
 }