Example #1
0
<?php

//gestion de session
include 'lib/app.php';
App::getSession();
//test a enlever
if (isset($_SESSION['id'])) {
    echo $_SESSION['id'];
}
// Début de la tamporisation de sortie
ob_start();
//"routage" du site web. EN fonction du parametre section, l'user est envoyé sur de differentes pages
//redirection vers index
if (!isset($_GET['section']) or $_GET['section'] == 'index') {
    include 'controleur/index/index.php';
} else {
    if ($_GET['section'] == 'hebergement') {
        include 'controleur/hebergement/hebergement.php';
    } else {
        if ($_GET['section'] == 'reservation') {
            include 'controleur/reservation/reservation.php';
        } else {
            if ($_GET['section'] == 'ajout_reservation') {
                include 'controleur/ajout_reservation/ajout_reservation.php';
            } else {
                if ($_GET['section'] == 'connexion') {
                    include 'controleur/connexion/connexion.php';
                } else {
                    if ($_GET['section'] == 'affichage_reservation') {
                        include 'controleur/affichage_reservation/affichage_reservation.php';
                    }
        <div class="visible-xs hidden-sm hidden-md hidden-lg">   
            <div class="media userlogged">
                <?php 
$imageurl = App::param('upload_url') . 'adminuser/';
$name = App::getSession('uprofile_pic');
?>
                <img alt="Profile Pic" title="<?php 
echo App::getSession('fullname');
?>
" src="<?php 
echo $imageurl . $name;
?>
" class="media-object">
                <div class="media-body">
                    <h4><?php 
echo App::getSession('fullname');
?>
</h4>
                </div>
            </div>

            <h5 class="sidebartitle actitle">Account</h5>
            <ul class="nav nav-pills nav-stacked nav-bracket mb30">

                <!--<li><a href="<?php 
echo App::param('siteurl') . "adminUsersMaster/UserProfile/";
?>
"><i class="fa fa-user"></i> My Profile</a></li>-->
                <!--<li><a href="<?php 
//echo App::param('siteurl')."AdminUsersMaster/".App::getSession('uid');
?>
 public function actionChangePassword()
 {
     //        $this->heading = "Change Password";
     $model = new UserMaster();
     if (isset($_POST['UserMaster'])) {
         $currPwd = $_POST['UserMaster']['CurrentPassword'];
         $encodedPswd = base64_encode($currPwd);
         $uId = App::getSession('uid');
         $criteria = new CDbCriteria();
         $criteria->addCondition("u_id = {$uId} AND user_pass = '******'");
         $countUser = $model->findAll($criteria);
         if (!empty($countUser)) {
             $model1 = new UserMaster();
             $countUser[0]->user_pass = base64_encode($_POST['UserMaster']['NewPassword']);
             //                $model1->modified_on=date('Y-m-d h:i');
             $countUser[0]->update();
             App::setSession('upassword', md5($countUser[0]->user_pass));
             Yii::app()->user->setFlash('success', 'Password has been updated successfully..');
             $this->redirect(App::param("siteurl") . "site/index");
         } else {
             Yii::app()->user->setFlash('error', 'Current Password is incorrect..');
             $this->redirect(App::param("siteurl") . "userMaster/ChangePassword/");
         }
     }
     $this->render('changepassword', array('model' => $model));
 }