Subversion Repositories Applications.gtt

Rev

Rev 80 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 80 Rev 103
Line 14... Line 14...
14
						'table' => 'gestion_utilisateur',
14
						'table' => 'gestion_utilisateur',
15
						'usernamecol' => 'gu_email',
15
						'usernamecol' => 'gu_email',
16
						'passwordcol' => 'gu_password',
16
						'passwordcol' => 'gu_password',
17
						'cryptype' => 'md5',
17
						'cryptype' => 'md5',
18
						'db_fields' => '*');
18
						'db_fields' => '*');
19
		// Création de l'objet auth
19
		// Création de l'objet auth
20
		$GLOBALS['_GTT_']['identification'] = new Auth('DB', $params, null, false);
20
		$GLOBALS['_GTT_']['identification'] = new Auth('DB', $params, null, false);
21
		$GLOBALS['_GTT_']['identification']->setSessionname(GTT_AUTH_SESSION_NOM);
21
		$GLOBALS['_GTT_']['identification']->setSessionname(GTT_AUTH_SESSION_NOM);
22
		$GLOBALS['_GTT_']['identification']->setExpire(time()+(int)GTT_AUTH_SESSION_DUREE);
22
		$GLOBALS['_GTT_']['identification']->setExpire(time()+(int)GTT_AUTH_SESSION_DUREE);
23
		$GLOBALS['_GTT_']['identification']->start();
23
		$GLOBALS['_GTT_']['identification']->start();
24
		setcookie(session_name(),session_id(), time()+(int)GTT_AUTH_SESSION_DUREE, "/");
24
		setcookie(session_name(),session_id(), time()+(int)GTT_AUTH_SESSION_DUREE, "/");
25
		if ($GLOBALS['_GTT_']['identification']->getAuth()) {
25
		if ($GLOBALS['_GTT_']['identification']->getAuth()) {
26
			require_once GTT_CHEMIN_METIER.'Utilisateur.class.php';
26
			require_once GTT_CHEMIN_METIER.'Utilisateur.class.php';
27
			$GLOBALS['_GTT_']['Utilisateur'] = new Utilisateur(Utilisateur::GU_MAIL, array($GLOBALS['_GTT_']['identification']->getUserName()));
27
			$GLOBALS['_GTT_']['Utilisateur'] = new Utilisateur(Utilisateur::GU_MAIL, array($GLOBALS['_GTT_']['identification']->getUserName()));
28
    		$aso_identification['nom'] = $GLOBALS['_GTT_']['Utilisateur']->getNom();
28
    		$aso_identification['nom'] = $GLOBALS['_GTT_']['Utilisateur']->getNom();
29
    		$aso_identification['prenom'] = $GLOBALS['_GTT_']['Utilisateur']->getPrenom();
29
    		$aso_identification['prenom'] = $GLOBALS['_GTT_']['Utilisateur']->getPrenom();
30
	    	// Récupération des infos sur l'utilisateur
30
	    	// Récupération des infos sur l'utilisateur
31
	 		$aso_identification['cp'] = $GLOBALS['_GTT_']['Utilisateur']->getCongesPayes();
31
	 		$aso_identification['cp'] = $GLOBALS['_GTT_']['Utilisateur']->getCongesPayes();
32
	 		$cp = $aso_identification['cp'] / $GLOBALS['_GTT_']['Utilisateur']->getTempsDeTravailJour();
32
	 		$cp = $aso_identification['cp'] / $GLOBALS['_GTT_']['Utilisateur']->getTempsDeTravailJour();
33
	 		$aso_identification['cp_j'] = round($cp, 1);
33
	 		$aso_identification['cp_j'] = round($cp, 1);
34
	 		$aso_identification['rtt'] = $GLOBALS['_GTT_']['Utilisateur']->getQuotaHeuresSupp();
34
	 		$aso_identification['rtt'] = $GLOBALS['_GTT_']['Utilisateur']->getQuotaHeuresSupp();
35
	 		$rtt = $aso_identification['rtt'] / $GLOBALS['_GTT_']['Utilisateur']->getTempsDeTravailJour();
35
	 		$rtt = $aso_identification['rtt'] / $GLOBALS['_GTT_']['Utilisateur']->getTempsDeTravailJour();
Line 47... Line 47...
47
    public function executerDeconnexion()
47
    public function executerDeconnexion()
48
    {
48
    {
49
    	$aso_connexion = array();
49
    	$aso_connexion = array();
50
		$this->getRegistre()->setTitre('Bienvenue sur GTT!');
50
		$this->getRegistre()->setTitre('Bienvenue sur GTT!');
51
    	$this->getRegistre()->ajouterSquelette('identification', 'connexion.tpl.html');
51
    	$this->getRegistre()->ajouterSquelette('identification', 'connexion.tpl.html');
52
    	// Création de l'url de réponse du formulaire
52
    	// Création de l'url de réponse du formulaire
53
		$aso_connexion['url'] = 'index.php?action='.GTT_ACTION_CONNEXION;
53
		$aso_connexion['url'] = 'index.php?action='.GTT_ACTION_CONNEXION;
54
    	$GLOBALS['_GTT_']['identification']->logout();
54
    	$GLOBALS['_GTT_']['identification']->logout();
Line 55... Line 55...
55
 
55
 
56
    	//echo '<pre>'.print_r($aso_connexion, true).'</pre>';
56
    	//echo '<pre>'.print_r($aso_connexion, true).'</pre>';