Exemple #1
0
function validate_login($username, $password, $token_form)
{
    //vèrifier si le nom d'utilisateur exist
    global $db;
    if (!$db->Query("SELECT * FROM users_sys where nom='{$username}' and pass='******'")) {
        $db->Kill('Error1');
    }
    if ($db->RowCount() > 0) {
        // Si MDP correcte  set Session
        $array = $db->RowArray();
        $user_name = $array['nom'];
        $user_id = $array['id'];
        $token = $token_form;
        $ssid = $token;
        $service = $array['servic'];
        $imda = $array['signature'];
        $defalutapp = $array['defapp'];
        $session = new session();
        $session->set('username', $array['nom']);
        $session->set('userid', $array['id']);
        $session->set('time', time());
        $session->set('ssid', $ssid);
        $session->set('agence', $array['agence']);
        $session->set('service', MInit::cryptage($service, 1));
        $session->set('imda', MInit::cryptage($imda, 1));
        $session->set('defapp', MInit::cryptage($defalutapp, 1));
        //RAZ CTC
        if (!$db->Query("update users_sys set  ctc=0,lastactive=CURRENT_TIMESTAMP where id=" . $user_id)) {
            $db->Kill('RAZ CTC');
        }
        //Save session
        $savessid_sql = "insert into session (id,user,dat) value('" . $ssid . "','" . $user_name . "',CURRENT_TIMESTAMP)";
        if (!$db->Query($savessid_sql)) {
            $db->Kill($db->Error());
        }
        //set_session($user_name,$user_id,$token,$service,$imda,$defalutapp,$time);
        return true;
    }
    //else utilisateur
}
Exemple #2
0
<?php

if (MInit::form_verif(false)) {
    $posted_data = array('modul' => Mreq::tp('modul'), 'description' => Mreq::tp('description'), 'app' => Mreq::tp('app'), 'sbclass' => Mreq::tp('sbclass'), 'id' => Mreq::tp('id'), 'id_checker' => Mreq::tp('id_checker'), 'id_app' => Mreq::tp('id_app'));
    //Check if array have empty element return list
    //for acceptable empty field do not put here
    $checker = null;
    $empty_list = "Les champs suivants sont obligatoires:\n<ul>";
    if ($posted_data['id_checker'] != MInit::cryptage($posted_data['id'], 1)) {
        $empty_list .= "<li>Le ID n'est pas Valid</li>";
        $checker = 1;
    }
    if ($posted_data['modul'] == NULL) {
        $empty_list .= "<li>Nom de module</li>";
        $checker = 1;
    }
    if (!MInit::is_regex($posted_data['modul'])) {
        $empty_list .= "<li>Nom de module non valid (a-z 1-9)</li>";
        $checker = 1;
    }
    if ($posted_data['description'] == NULL) {
        $empty_list .= "<li>Déscription</li>";
        $checker = 1;
    }
    if ($posted_data['app'] == NULL) {
        $empty_list .= "<li>Nom de l'application de base</li>";
        $checker = 1;
    }
    if (!MInit::is_regex($posted_data['app'])) {
        $empty_list .= "<li>Nom de l'application non valid (a-z 1-9)</li>";
        $checker = 1;
Exemple #3
0
 public static function get($var)
 {
     return isset($_SESSION[$var]) ? MInit::cryptage($_SESSION[$var], 0) : FALSE;
 }
Exemple #4
0
										</td>

										<td class="hidden-480">
											<span class="label label-info arrowed-in arrowed-in-right">Online</span>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div><!-- /.span -->
		</div><!-- /.row -->
		<?php 
$sarot = 'mGqjJ1rRBNcOv33juhBnBDA5/Vd4A5lkZNxMSDw7tDg=';
echo MInit::cryptage($sarot, 0);
?>
		<!-- PAGE CONTENT END -->
	</div>
</div>
<script type="text/javascript">

			jQuery(function($) {

				
			
				$('#simple-colorpicker-1').ace_colorpicker({pull_right:true}).on('change', function(){
					var color_class = $(this).find('option:selected').data('class');
					var new_class = 'widget-box';
					if(color_class != 'default')  new_class += ' widget-color-'+color_class;
					$(this).closest('.widget-box').attr('class', new_class);
Exemple #5
0
<?php

$info_modul = new Mmodul();
$info_modul->id_modul = Mreq::tp('id');
if (md5(MInit::cryptage(Mreq::tp('id'), 1)) != Mreq::tp('idc') or !$info_modul->get_modul()) {
    exit('3#' . $info_modul->log . '<br>Les informations pour cette ligne sont erronées contactez l\'administrateur');
}
?>
<div class="page-header">
	<h1>
		Gestion Modules
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
		</small>
		<?php 
$info_modul->Shw('modul');
?>
	</h1>
</div><!-- /.page-header -->

<div class="row">
	<div class="col-xs-12">
		<div class="clearfix">
			<div class="pull-right tableTools-container">
				<div class="btn-group btn-overlap">
					
					<?php 
TableTools::btn_add('addtask', 'Ajouter Application Task', 'id=' . $info_modul->id_modul . '&idc=' . md5($info_modul->id_modul));
?>
					
				</div>
Exemple #6
0
			
		</div>
		<div class="table-header">
			Formulaire: "<?php 
echo ACTIV_APP;
?>
"

		</div>
		<div class="widget-content">
			<div class="widget-box">
				
<?php 
$form = new Mform('editmodul', 'editmodul', 'modul');
$form->input_hidden('id', $info_modul->Shw('id'));
$form->input_hidden('id_checker', MInit::cryptage($info_modul->Shw('id'), 1));
$form->input_hidden('id_app', $info_modul->Shw('id_app'));
//Titre bloc Modul
$form->bloc_title('Informations Module');
//Nom Module
$modul_array[] = array('required', 'true', 'Insérer Nom de Module');
$modul_array[] = array('minlength', '3', 'Minimum 3 caractères');
$modul_array[] = array('regex', 'true', 'Insérer Nom de Modul Valid');
$form->input('Nom Module', 'modul', 'text', 6, $info_modul->Shw('modul'), $modul_array);
//Déscription Module
$description_array[] = array('required', 'true', 'Insérer Prénom utilisateur');
$description_array[] = array('minlength', '3', 'Minimum 3 caractères');
$form->input('Déscription', 'description', 'text', 10, $info_modul->Shw('description'), $description_array);
//Titre bloc default TASK
$form->bloc_title('Informations Application par défault');
//Nom Application
Exemple #7
0
 public function action_task()
 {
     $this->get_task();
     if ($this->modul_info['id'] == null) {
         $this->app_action .= 'Fatal Error';
         print $this->app_action;
         return false;
     }
     global $db;
     $user = session::get('userid');
     $etat = $this->modul_info['etat'];
     $id = $this->modul_info['id'];
     $sql = "SELECT task_action.code FROM \ntask_action, rules_action, task \nWHERE rules_action.action_id = task_action.id \nAND task.etat = task_action.etat_line \nAND task_action.appid = 34\nAND rules_action.userid = {$user} \nAND task.etat = {$etat} \nAND task.id = {$id}\nAND task_action.type = 0 ";
     if (!$db->Query($sql)) {
         $this->error = false;
         $this->log .= $db->Error();
         //return false;
     } else {
         if ($db->RowCount() == false) {
             $this->error = false;
             $this->app_action .= 'Pas d\'action trouvée! ' . $sql;
             return print $this->app_action;
         } else {
             //$this->log = $sql;
             //$this->app_action = $db->RowArray();
             $this->error = true;
             while (!$db->EndOfSeek()) {
                 $row = $db->Row();
                 $this->app_action .= $row->code;
             }
             $retour = str_replace('%id%', $id, $this->app_action);
             $retour = str_replace('%idc%', MInit::cryptage($id, 1), $retour);
             return print $retour;
         }
     }
     //return true;
 }