Exemplo n.º 1
0
        $output = "<div class=\"alert {$class} \"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"icon-remove\"></i></button><strong><i class=\"icon-remove\"></i>Erreur! </strong>{$message}</div>";
        exit("2# {$output}");
    }
    //Check user signature
    if (!login_check_user_sign(MReq::tp('user'), MReq::tp('pass'))) {
        $message = "Votre signature n'est pas enregistrée </br> Contactez l'administrateur";
        $class = "alert-error";
        $output = "<div class=\"alert {$class} \"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"icon-remove\"></i></button><strong><i class=\"icon-remove\"></i>Erreur! </strong>{$message}</div>";
        exit("3# {$output}");
    }
    //Password ok and validat login
    if (!login_check_user_pass(MReq::tp('user'), MReq::tp('pass'), MReq::tp('token'))) {
        global $db;
        $message = "Le mot de passe est incorrect </br> Contactez l'administrateur";
        $class = "alert-error";
        $output = "<div class=\"alert {$class} \"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"icon-remove\"></i></button><strong><i class=\"icon-remove\"></i>Erreur! </strong>{$message}</div>";
        exit("4# {$output}");
        //wrong Pass
    } else {
        $user = MReq::tp('user');
        $username = $db->QuerySingleValue0("SELECT CONCAT(lnom,' ',fnom) FROM users_sys where nom='{$user}'");
        $message = "Bienvenue <strong>{$username} </strong></br> Vous serez rédiriger dans qulques instants";
        $class = "alert-success";
        $output = "<div class=\"alert {$class} \"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"icon-remove\"></i></button><strong><i class=\"icon-remove\"></i> OK ! </strong><br>{$message}</div>";
        exit("5# {$output}");
        //All is ok
    }
} else {
    //exit(MReq::tp('check').MReq::tp('user').MReq::tp('pass'));
    view::load('login', 'login');
}
Exemplo n.º 2
0
 public function load()
 {
     //exit($this->default_app);
     //Do ALL check if error =  false exit log
     if ($this->error == true) {
         $this->Check_exist_tsk();
     }
     if ($this->error == true) {
         $this->Check_exist_app();
     }
     if ($this->error == true) {
         $this->Check_is_ajax_request();
     }
     if ($this->error == true) {
         $this->Check_session_template();
     }
     if ($this->error == true) {
         $this->Check_user_active();
     }
     if ($this->error == true) {
         $this->Check_need_session();
     }
     if ($this->error == true) {
         $this->Check_user_permission();
     }
     if ($this->error == true) {
         $this->last_active();
     }
     if ($this->error == false) {
         if ($this->is_appli == true) {
             echo '<div class="space-16"></div><div class="space-16"></div><div class="alert alert-block alert-danger"><i class="ace-icon fa fa-exclamation-circle red fa-2x icon-animated-vertical"></i> <strong class="red"> STOP: </strong>' . $this->msg_ajax . $this->log . '<br><a href="./" class="btn btn-danger btn-sm"><i class="ace-icon fa fa-reply icon-only"> Accueil</i></a></div>';
         } else {
             exit($this->msg_ajax . $this->log);
         }
     } else {
         //sleep(5);
         if (MReq::tp('act') == 1) {
             $target = MPATH_MODULES . $this->app_array['rep'] . SLASH . 'controller/action' . $this->app_array['file'] . '_c.php';
         } elseif (MReq::tp('lst') == 1) {
             $target = MPATH_MODULES . $this->app_array['rep'] . SLASH . 'controller/list' . $this->app_array['file'] . '_c.php';
         } else {
             $target = MPATH_MODULES . $this->app_array['rep'] . SLASH . 'controller/' . $this->app_array['file'] . '_c.php';
         }
         if (!file_exists($target)) {
             exit($this->msg_ajax . '//FILE' . $target);
         } else {
             define('ACTIV_APP', $this->app_array['dscrip']);
             define('MODUL_APP', $this->app_array['modul']);
             define('APP_TARGET', MPATH_MODULES . $this->app_array['rep'] . SLASH . 'controller/');
             define('APP_ID', $this->app_array['id']);
             //Append tree top menu only for no appli App
             if ($this->is_appli == false && MReq::tp('cor') == 1) {
                 $output = '<li><i class="ace-icon fa fa-home home-icon"></i><a href="#" left_menu="1" class="tip-right this_url" rel="dbd" title="Tableau de bord">Accueil</a></li>';
                 $output .= '<li><a href="#" left_menu="1" class="tip-right this_url" rel="' . $this->app_array['app_modul'] . '" title="' . $this->app_array['modul'] . '">' . $this->app_array['modul'] . '</a></li>';
                 $output .= '<li class="active">' . $this->app_array['dscrip'] . '</li>';
                 $output .= '#||#';
                 //Separator data
                 print $output;
             }
             require_once $target;
             //var_dump($_SESSION);
         }
     }
 }
Exemplo n.º 3
0
<?php

if (MInit::form_verif(false)) {
    $add_rule = new Musers();
    $add_rule->last_id = MReq::tp('userid');
    $add_rule->clear_user_rules();
    //Clear all rule for this user
    for ($i = 0, $c = count(MReq::tp('action_id')); $i < $c; $i++) {
        $the_i = MReq::tp('action_id')[$i];
        $posted_data = array('action_id' => MReq::tp('action_id')[$i], 'app_name' => MReq::tp('app_name' . $the_i), 'app_id' => MReq::tp('app_id' . $the_i), 'type' => MReq::tp('type' . $the_i), 'userid' => MReq::tp('userid'));
        $add_rule->app_action = $posted_data;
        $add_rule->add_user_rules();
        //var_dump($add_rule->_data);
    }
    //execute Insert returne false if error
    if ($add_rule->error = true) {
        echo "1#Enregistrement réussie";
        //if we leave Muser->log show line for each rule
    } else {
        echo "0#" . $add_rule->log;
    }
} else {
    view::load('users', 'rules');
}
Exemplo n.º 4
0
<?php

global $db;
//Home Link
$output = '<li><i class="ace-icon fa fa-home home-icon"></i><a href="./">Accueil</a></li>';
//get info from task table
if (!$db->Query("SELECT modul,dscrip FROM task\n                 where  app='" . MReq::tp('app') . "' ")) {
    $db->Kill($db->Error());
}
if ($db->RowCount() > 0) {
    $array = $db->RowArray();
    $output .= '<li class="active">' . $array['modul'] . '</li>';
    $output .= '<li class="active">' . $array['dscrip'] . '</li>';
}
//Print Tree Application
echo $output;
Exemplo n.º 5
0
    $class = "";
    $output = "";
    global $db;
    model::load('login', 'login');
    //check user exist
    if (!check_email(MReq::tp('email'))) {
        $message = "Cette Adresse (" . MReq::tp('email') . ") E-mail n'exist pas";
        $class = "alert-error";
        $output = $message;
        exit("3# {$output}");
    }
    // Check Captcha Code
    if (!check_captcha(MReq::tp('captcha'))) {
        $message = "Le code anti-robots est incorrect";
        $class = "alert-error";
        $output = $message;
        exit("2# {$output}");
    }
    //All is OK send email
    if (!forgot(MReq::tp('email'), MReq::tp('captcha'))) {
        $message = "Erreur Système";
        $class = "alert-error";
        $output = $message;
        exit("4# {$output}");
    } else {
        $message = "Un message de récupération est envoyé dans votre boite";
        $class = "alert-success";
        $output = "<div class=\"alert {$class} \"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"icon-remove\"></i></button><strong><i class=\"icon-remove\"></i> OK ! </strong><br>{$message}</div>";
        exit("5# {$output}");
    }
}
Exemplo n.º 6
0
    }
} else {
    exit(MInit::msgbox('error_recovery'));
}
//End Check Valid link
//Reset Password
if (MReq::tp('check') == 1) {
    //check token in post
    if (!Mpswrecovery::check_token($token)) {
        $message = "Vous avez tentez de changer le mot de passe utilison un token non valide !";
        $class = "alert-error";
        $output = "{$message}";
        exit("1# {$output}");
    }
    //check passwords confirmed
    if (MReq::tp('psw1') != MReq::tp('psw2')) {
        $message = "Les mots de passe ne sont pas compatible !";
        $class = "alert-error";
        $output = "{$message}";
        exit("1# {$output}");
    }
    $posted_data = array('token' => Mreq::tp('token'), 'pass' => Mreq::tp('psw1'));
    $new_pass = new Mpswrecovery($posted_data);
    if ($new_pass->reset_passwors()) {
        exit('5#Votre mot de passe est bien changé redirection vers page de connexion.');
    } else {
    }
} else {
    view::load('login', 'recovery');
}
//End Reset Password
Exemplo n.º 7
0
    $array = array('host' => MReq::tp('host'), 'pass' => MReq::tp('passwords'), 'database' => MReq::tp('db'), 'user' => MReq::tp('compte'));
    $test = MCfg::setarray($array);
    $db_host = MReq::tp('host');
    // server name
    $db_user = MReq::tp('compte');
    // user name
    $db_pass = MReq::tp('passwords');
    // password
    $db_dbname = MReq::tp('db');
    $db = new MySQL(true, $db_dbname, $db_host, $db_user, $db_pass);
    $values["nom"] = MySQL::SQLValue(MReq::tp('username'));
    $values["mail"] = MySQL::SQLValue(MReq::tp('email'));
    $values["pass"] = MySQL::SQLValue(md5(MReq::tp('password')));
    $values["servic"] = MySQL::SQLValue('1');
    $values["fnom"] = MySQL::SQLValue(MReq::tp('firstname'));
    $values["lnom"] = MySQL::SQLValue(MReq::tp('lastname'));
    $values["tel"] = MySQL::SQLValue(012222222);
    $values["active"] = MySQL::SQLValue(1);
    $values["defapp"] = MySQL::SQLValue(3);
    $values["agence"] = MySQL::SQLValue(2);
    $values["signature"] = MySQL::SQLValue("");
    // Execute the insert
    $result = $db->InsertRow("users_sys", $values);
    if (!$result) {
        $db->Kill($db->Error());
    }
    exit('5# dakchi daz mziane');
    //model::load('user','user');
    //adduser(MReq::tp('username'),MReq::tp('firstname'),MReq::tp('lastname'),MReq::tp('password'),MReq::tp('email'),' ',' ',' ',' ',' ');
    //
} else {