Esempio n. 1
0
 public static function load()
 {
     $msg_ajax = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\AJAX";
     $msg_app = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\APP";
     $msg_file = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\FILE";
     $msg_perm = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\PERMISSION_USER";
     $msg_sess = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\SESSION_USER";
     //Check if is Ajax request
     if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) && MReq::tg('_tsk') !== 'shopdf') {
         exit('no way !!!');
     }
     if (defined('GOTO_INSTALL')) {
         $app_target = MPATH_MODULES . 'install' . SLASH . 'controller/install_c.php';
         require_once $app_target;
     } else {
         global $db;
         Cookie::auto_lastexec('time');
         Cookie::auto_logout('time', 600);
         //Cookie::session_autoclosed();
         //Start check APP
         if (MReq::tg('_tsk') == '0') {
             exit("3#{$msg_app}");
         }
         $app_id = MReq::tg('_tsk');
         if (!$db->Query("SELECT * FROM task where  app='" . $app_id . "' ")) {
             $db->Kill($db->Error());
         }
         if ($db->RowCount() == 0) {
             exit("3#{$msg_app}");
         }
         $array = $db->RowArray();
         $appc_idc = $array['id'];
         $needsession = $array['session'];
         $app_rep = $array['rep'];
         $app_file = $array['file'];
         $app_target = MPATH_MODULES . $app_rep . SLASH . 'controller/' . $app_file . '_c.php';
         //Check if is good appli not need session
         $good_app = $db->QuerySingleValue0("select modul from task where id = {$appc_idc}");
         if ($needsession == 1 && !isset($_SESSION['userid'])) {
             exit("3#{$msg_sess}");
         }
         if ($good_app == "0") {
             $sql = "SELECT *  FROM permission_users where perm=1 and  appid=" . $appc_idc . " and userid=" . $_SESSION['userid'];
             if (!$db->Query($sql)) {
                 $db->Kill($db->Error());
             }
             if ($db->RowCount() <= 0) {
                 exit("3#{$msg_perm} select modul from task where id = {$appc_idc} ");
             }
         }
         if (!file_exists($app_target)) {
             exit("3#{$msg_file} {$app_target}");
         }
         define('ACTIV_APP', $array['dscrip']);
         define('MODUL_APP', $array['modul']);
         define('APP_ID', $array['id']);
         require_once $app_target;
     }
 }
Esempio n. 2
0
 private function Check_exist_tsk()
 {
     $this->app_id = $this->default_app == null ? MReq::tg('_tsk') : $this->default_app;
     if ($this->app_id == '0') {
         $this->error = false;
         $this->log .= '//TG_TSK_NULL';
     } else {
         $this->error = true;
     }
 }
Esempio n. 3
0
 public static function load()
 {
     //Define Theme depend to session
     define('THEME_PATH', MPATH_THEMES . Mcfg::get('theme'));
     //exit(THEME_PATH);
     $ajax = MReq::tg('ajax') == 1 ? 1 : 0;
     if ($ajax == 1) {
         //Excute app on ajax
         ajax::load();
     } else {
         //Excute app on theme
         $theme_path = THEME_PATH;
         $theme = session::get('userid') == FALSE ? $theme_path . '/mainns.php' : $theme_path . '/main.php';
         include $theme;
     }
 }
Esempio n. 4
0
    }
    if ($posted_data['token'] == NULL || strlen($posted_data['token']) != 32) {
        $empty_list .= "<li>Le token est Invalide</li>";
        $checker = 1;
    }
    $empty_list .= "</ul>";
    if ($checker == 1) {
        exit("0#{$empty_list}");
    }
    //End check empty element
    $new_recovery = new Musers($posted_data);
    $new_recovery->token = $posted_data['token'];
    //execute Login returne false if error
    if ($new_recovery->recovery_pass()) {
        echo "1#" . $new_recovery->log;
    } else {
        echo "0#" . $new_recovery->log;
    }
} else {
    if (MReq::tg('token') != "0") {
        $token = MReq::tg('token');
        $check_token = new Musers();
        $check_token->token = $token;
        if (!$check_token->check_recovery_token()) {
            exit($check_token->log);
        }
    } else {
        exit(MInit::msgbox('error_recovery'));
    }
    view::load('login', 'recovery');
}
Esempio n. 5
0
    <div id="login-box" class="login-box visible widget-box no-border">
      <div class="widget-body">
        <div class="widget-main">
          <h4 class="header blue lighter bigger">
            <i class="fa fa-lock green"></i>
            Réinitialisation du Mot de Passe


          </h4>

          <div class="space-6"></div>
          <form novalidate="novalidate" id="recovery" action="#" method="post" />
          <fieldset>
            <input name="verif" type="hidden" value="1" />
            <input name="token" type="hidden" value="<?php 
echo MReq::tg('token');
?>
" />
            
            <div class="form-group">
              <label class="block clearfix">
                <span class="block input-icon input-icon-right">
                  <input type="password" id="pass" name="pass" class="form-control" placeholder="Mot de passe" />
                  <i class="ace-icon fa fa-lock"></i>
                </span>
              </label>
            </div>
            <div class="form-group">

              <label class="block clearfix ">
                <span class="block input-icon input-icon-right">