当前位置: 首页>>代码示例>>PHP>>正文


PHP getSessionUser函数代码示例

本文整理汇总了PHP中getSessionUser函数的典型用法代码示例。如果您正苦于以下问题:PHP getSessionUser函数的具体用法?PHP getSessionUser怎么用?PHP getSessionUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getSessionUser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayAdminControls

function displayAdminControls($user)
{
    if (!isset($user)) {
        $user = getSessionUser();
    }
    if ($user->isAdmin()) {
        include "../views/adminButton.view.php";
    }
}
开发者ID:cownby,项目名称:weblab2015-project,代码行数:9,代码来源:utilities.php

示例2: checkAdminPwd

/**
 * Fonction vérifiant le password de l'admin.
 * @return bool : true si le password est bon, sinon false.
 */
function checkAdminPwd()
{
    $userSession = getSessionUser();
    $userMdpTest = new User(array("Mdp" => $_POST['mdpAdmin']));
    $userMdpTest->setHashMdp();
    if ($userSession->getDroit()[0]->getLibelle() and $userSession->getMdp() == $userMdpTest->getMdp()) {
        return true;
    }
    return false;
}
开发者ID:OvynFlavian,项目名称:IntegrationTP_Groupe_1,代码行数:14,代码来源:session.lib.php

示例3: userHoldsRight

function userHoldsRight($RightId, $SessionId)
{
    global $Mysql;
    $UserId = getSessionUser($SessionId);
    $getUserRight = $Mysql->query("SELECT * FROM rights_assigned WHERE UserId='{$UserId}' AND RightId='{$RightId}'");
    if ($getUserRight->num_rows == 0) {
        return false;
    } else {
        return true;
    }
}
开发者ID:nzol,项目名称:roadshow,代码行数:11,代码来源:globalfunctions.php

示例4: printLogEntry

function printLogEntry($name, $gc, $type, $created, $log, $logId, $username, $logType, $difficulty, $terrain, $favorites, $finds, $country, $url, $sessionResults, $address, $district, $lat, $lon)
{
    $type = determineTypeIcon($type);
    $difficulty = ratingToStars("D:", $difficulty);
    $terrain = ratingToStars("T:", $terrain);
    $district = districtToImage($country, $district);
    $country = countryToImage($country);
    $logType = determineLogTypeIcon($logType);
    $ratio = findsToRatio($finds, $favorites);
    $favorites = favoritesToHearts($favorites);
    $images = DB::queryFirstColumn("SELECT\n                                           url\n                                         FROM\n                                           image\n                                         WHERE\n                                           image.log = %i", $logId);
    if (isset($lat) && isset($lon)) {
        $address = "<a href='http://maps.google.com/maps?q={$lat},{$lon}'>{$address}</a>";
    }
    if (substr($created, 0, 10) == date('d.m.Y')) {
        echo "<div class='panel panel-primary'>";
    } else {
        echo "<div class='panel panel-info'>";
    }
    $favoritesRatio = "";
    if ($favorites != "" && $ratio != "") {
        $favoritesRatio = "({$favorites} {$ratio})";
    }
    if ($type != "") {
        echo "<div class='panel-heading'><a href='{$url}'><b>{$name}</b></a> <img src='res/icons/{$type}' width='20px' /> {$difficulty} {$terrain} {$favoritesRatio} {$country} {$district} {$address}</div>";
    } else {
        echo "<div class='panel-heading'><b>{$name}</b></div>";
    }
    echo "<div class='panel-body'>{$log}";
    if (!empty($images)) {
        foreach ($images as $image) {
            echo '<img class="img-rounded img-padding" src="' . $image . '" />';
        }
    }
    echo "</div>";
    $urlencodedUsername = urlencode($username);
    if (in_array($gc, $sessionResults) && $username != getSessionUser()) {
        echo "<div class='panel-footer'><a class='u' href='index.php?username={$urlencodedUsername}'>{$username}</a> {$logType} {$created} (You <i class='fa fa-thumbs-up'></i> this one too.)</div>";
    } else {
        echo "<div class='panel-footer'><a class='u' href='index.php?username={$urlencodedUsername}'>{$username}</a> {$logType} {$created}</div>";
    }
    echo "</div>";
}
开发者ID:mircowidmer,项目名称:geonews,代码行数:43,代码来源:general.php

示例5: editProfil

function editProfil()
{
    $user = getSessionUser();
    ?>

<form class="form-horizontal" action="profil.page.php?to=edit" method="post">
    <div class="form-group">
        <label class="control-label col-sm-3" for="userName">Changement de pseudo:</label>
        <div class="col-sm-6">
            <input type="text" class="form-control" id="userName" name="userName" value="<?php 
    echo $user->getUserName();
    ?>
" placeholder="Votre pseudo">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3" for="userName">Changement d'adresse mail:</label>
        <div class="col-sm-6">
            <input type="email" class="form-control" id="email" name="email" value="<?php 
    echo $user->getEmail();
    ?>
" placeholder="Votre email">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3" for="Mdp">Changement de mot de passe:</label>
        <div class="col-sm-6">
            <input type="password" class="form-control" id="Mdp" name="Mdp" placeholder="Entrez votre mot de passe">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3" for="MdpBis">Réentrez votre changement de mot de passe :</label>
        <div class="col-sm-6">
            <input type="password" class="form-control" id="MdpBis" name="MdpBis" placeholder="Réentrez votre mot de passe">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3" for="Tel">Changer de numéro de téléphone:</label>
        <div class="col-sm-6">
            <input type="text" class="form-control" id="Tel" name="Tel" value="<?php 
    echo $user->getTel();
    ?>
" placeholder="Entrez votre numéro de téléphone">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-3 col-sm-10">
            <div class="checkbox">
                <label>
                    <input  type="checkbox" id="Private" name="Private" value="1" <?php 
    if ($user->getIsPrivate() == 1) {
        ?>
checked<?php 
    }
    ?>
>S'afficher en public
                </label>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3" for="MdpActuel">Entrez votre mot de passe actuel : (obligatoire pour le changement) </label>
        <div class="col-sm-6">
            <input type="password" class="form-control" id="MdpActuel" name="MdpActuel" placeholder="Entrez votre mot de passe actuel" required>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-3 col-sm-6">
            <button type="submit" class="btn-block btn-primary btn-lg" name="formulaire" id="formulaire">Soumettre</button>
        </div>
    </div>
</form>
<?php 
}
开发者ID:OvynFlavian,项目名称:IntegrationTP_Groupe_1,代码行数:74,代码来源:profil.form.php

示例6: changeownpass

 public function changeownpass()
 {
     if (isStudent()) {
         $this->kickOut();
     }
     if ($_POST) {
         $this->form_validation->set_rules('password1', 'New Password', 'trim|required|xss_clean');
         $this->form_validation->set_rules('password', 'Confirm Password', 'trim|required|xss_clean');
     }
     if ($this->form_validation->run() == FALSE) {
         $errors = validation_errors();
         if (!empty($errors)) {
             addError($errors);
         }
     } else {
         $username = getSessionUser();
         $result = $this->users->changePassword($username, $this->input->post('password'));
         if ($result) {
             addSuccess(getTxt('CongratulationsChangedPassword') . " " . $username);
         } else {
             addError(getTxt('ProcessingError'));
         }
     }
     //List of CSS to pass to this view
     $data = $this->StyleData;
     $this->load->view('users/change_yourpassword', $data);
 }
开发者ID:CMIP5,项目名称:HUC8Climate,代码行数:27,代码来源:user.php

示例7: header

    $_SESSION['error'] = "Sign in!";
    header('Location: form.php');
    die;
}
$user = $_SESSION['username'];
$user_id = $_SESSION['user_id'];
if (!getSessionUser($user, $user_id)) {
    session_destroy();
    header('Location: form.php');
    die;
}
/* MESSAGE POST-IT */
print '<div id="post_it"></div>';
require_once 'request.php';
/* DEFINE VARS */
$sess = getSessionUser($user, $user_id);
$get = getUser($user);
$post = getAllPosts();
$profile = 'all';
$fulltag = '';
/* WHICH POSTS TO SHOW*/
if (isset($_GET['profile'])) {
    $profile = preg_replace("/[^a-zA-Z0-9@#]/", "", $_GET['profile']);
    if ($profile == 'all') {
        $post = getAllPosts();
    } elseif ($profile == 'at' . $sess['username']) {
        $post = findAt($sess['username']);
    } elseif (!$profile == getUser($profile)) {
        print '<div class="post_it"><h3>';
        print "There's no user with that name...";
        print '</h3><button type="button" id="hide_btn" class="button">close</button></div>';
开发者ID:nilvisa,项目名称:litter,代码行数:31,代码来源:header.php

示例8: header

    exit;
}
$userid = $result['userid'];
$op = $result['op'];
$task = $op['single_task'];
if ($task['completed'] == 1) {
    header('location: index.php');
    exit;
}
$sid = createNewSessionByUserid($userid);
if (is_null($sid)) {
    header('location: index.php');
    exit;
}
setcookie('sid', $sid, time() + 365 * 24 * 60 * 60);
$user = getSessionUser($sid);
if (is_null($user)) {
    setcookie('sid', '', time() - 3600);
    header('Location: index.php');
    exit;
}
$css = array('home.css', 'task-completed.css');
include 'common/header.php';
include 'lib/op-with-tasks-view.php';
?>

    
    <div class="container sections-wrapper"><div class="row"><div class="col-md-6 col-md-offset-3 col-sm-12">

    <h2>Problem Reported!</h2>
    <p>The problem completing this task has been reported. <br/><br/>
开发者ID:jrharshath,项目名称:martaarmy_barracks,代码行数:31,代码来源:task-problem.php

示例9: addStationsFromDb

        <div class='panel-heading'>No geocaches with location data found</div>
        <div class='panel-body'>None of the geocaches you have found contain location data. Upload your finds <a href="upload.php">here</a>.</div>
      </div>
    </div>
    <div id="map" hidden="hidden"></div>
<?php 
if (isEmbedded()) {
    ?>
    <script type="text/javascript">
        $('#map').height($(window).height());
        addStationsFromDb(<?php 
    echo "'" . getSessionUser() . "'";
    ?>
);
    </script>
<?php 
} else {
    ?>
    <script type="text/javascript">
        $('#map').height($(window).height() - 50);
        addStationsFromDb(<?php 
    echo "'" . getSessionUser() . "'";
    ?>
);
    </script>
<?php 
}
?>
    </body>
</html>
开发者ID:mircowidmer,项目名称:geonews,代码行数:30,代码来源:map.php

示例10: finishWith

return:
{
	'status': 'success' // 'fail', 'nologin', 'missingdata', 'missingfield'
}
*/
function finishWith($status, $sid = NULL)
{
    exit(json_encode(array('status' => $status)));
}
if (!isset($_COOKIE["sid"])) {
    finishWith('nologin');
}
include '../lib/db.php';
include '../lib/op-with-tasks-view.php';
init_db();
$user = getSessionUser($_COOKIE["sid"]);
if (is_null($user)) {
    setcookie('sid', '', time() - 3600);
    finishWith('nologin');
}
if (!isset($_POST['opid'])) {
    finishWith('missingopid');
}
$opid = intval($_POST['opid']);
$op = getOperationById($opid);
$op_part_data = NULL;
if (!is_null($op['data'])) {
    if (!isset($_POST['data'])) {
        finishWith('missingdata');
    }
    $indata = json_decode($_POST['data']);
开发者ID:jrharshath,项目名称:martaarmy_barracks,代码行数:31,代码来源:join-op.php

示例11: getUser

<meta name="mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" href="img/logo_icon.png"/>
<link rel="apple-touch-icon-precomposed" href="img/logo_icon.png"/>
<link rel="icon" sizes="192x192" href="img/logo_icon.png">
<link rel="icon" sizes="128x128" href="img/logo_icon.png">
<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
<link rel="stylesheet" href="css/foundation.css" />
<link rel="stylesheet" href="css/plantyCustom.css" />
<link rel="manifest" href="manifest.json">
<script src="js/vendor/modernizr.js"></script>
<script src="js/planty.js"></script>
<link rel="stylesheet" href="css/plantyCustom.css" />
</head>
<body>
<?php 
$user = getUser(getSessionUser());
?>
<div class="row">
	<div class="large-12 columns">

		<div class="row">
			<div class="large-12 columns headerFix">
				<nav class="top-bar" data-topbar>
					<ul class="title-area">

						<li class="name">
            	<a href="index.php" alt="Planty"><img src="/img/logo_text.png" class="logoText"/></a>
						</li>
						<li class="toggle-topbar menu-icon"><a href="#" class="welcomeText">Welcome, <span><?php 
echo $user->name;
?>
开发者ID:skin,项目名称:planty,代码行数:31,代码来源:header.php

示例12: array

$november = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
$december = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
$year = array();
$year[0] = $january;
$year[1] = $february;
$year[2] = $march;
$year[3] = $april;
$year[4] = $may;
$year[5] = $june;
$year[6] = $july;
$year[7] = $august;
$year[8] = $september;
$year[9] = $october;
$year[10] = $november;
$year[11] = $december;
$results = DB::query("SELECT DISTINCT\n                          month(log.created) as 'month',\n                          day(log.created) as 'day'\n                        FROM\n                          geocache, log, logtype, user, type\n                        WHERE\n                          geocache.id = log.geocache AND\n                          log.user = user.id AND\n                          type.id = geocache.type AND\n                          log.type = logtype.id AND\n                          (logtype.type = 'Found it' OR logtype.type = 'Attended' OR logtype.type = 'Webcam Photo Taken') AND\n                          user.username = %s\n                        ORDER BY\n                          log.created DESC,\n                          log.id DESC", getSessionUser());
$total = 0;
foreach ($results as $row) {
    $month = $row['month'] - 1;
    $day = $row['day'] - 1;
    $year[$month][$day] = 1;
    $total++;
}
function printMonth($month)
{
    foreach ($month as $day) {
        if ($day == '1') {
            echo '<td style="background-color: #D0F5A9;"><i class="fa fa-calendar-check-o"></i></td>';
        } else {
            echo '<td style="background-color: #F5D0A9;"><i class="fa fa-calendar-minus-o"></i></td>';
        }
开发者ID:mircowidmer,项目名称:geonews,代码行数:31,代码来源:dateMatrix.php

示例13: getSessionUser

                        echo "<tr>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td><a href=\"index.php?a=30&b=2&idstatut=2&idsession=" . $idsession . "&iduser=" . $row["id_user"] . "\"><button type=\"button\" class=\"btn bg-purple sm\"  title=\"Mettre en liste d'attente\"><i class=\"fa fa-repeat\"></i></button></a></td>\n\t\t\t\t\t\t\t\t<td>" . $row["nom_user"] . " " . $row["prenom_user"] . "</td>\n\t\t\t\t\t\t\t\t<td>" . $affichage . "</td>\n                                 </tr>";
                    }
                }
                ?>
          </tbody></table>
		  <?php 
            }
        }
    }
    ?>
		</div>
	</div>
		
	<?php 
    // liste des user en liste d'attente
    $result = getSessionUser($idsession, 2);
    $nb = mysqli_num_rows($result);
    if ($nb > 0) {
        ?>
              
     	
		<div class="box box-success"><div class="box-header"><h3 class="box-title">Liste des participants en liste d'attente   <small class="badge bg-blue" data-toggle="tooltip" title="Classement par ordre d'arriv&eacute;e, du plus ancien au plus r&eacute;cent"><i class="fa fa-info"></i></small></h3></div>
		<div class="box-body"><table class="table">
				<thead> 
					<th></th> 
					
					<th>Nom, prenom</th>
					<!--<th>autres inscriptions (pdf)</th>-->
				</thead><tbody>
		<?php 
        for ($i = 1; $i <= $nb; $i++) {
开发者ID:ctariel,项目名称:CyberGestionnaireLGB,代码行数:31,代码来源:admin_session.php

示例14: dirname

<?php

require_once dirname(__FILE__) . "/settings.php";
require_once dirname(__FILE__) . "/lang/" . $langauge . ".php";
require_once dirname(__FILE__) . "/funcs.general.php";
require_once dirname(__FILE__) . "/class.RCAPI.php";
require_once dirname(__FILE__) . "/class.redcapAuth.php";
require_once dirname(__FILE__) . "/class.redcapportaluser.php";
require_once dirname(__FILE__) . "/class.mail.php";
require_once dirname(__FILE__) . "/class.htmlpage.php";
$PAGE = basename($_SERVER["SCRIPT_FILENAME"]);
$start_time = microtime(true);
// $end_time = microtime(true) - $start_time; //measure script time
/*
	Start Session and determine if we are authenticated
	Authenticated means user+pass has matched, but does NOT mean the account is active
*/
session_start();
$loggedInUser = getSessionUser();
if (!empty($loggedInUser)) {
    // Check for logout
    if (isset($_GET['logout']) && $_GET['logout'] == 1) {
        logout("Goodbye!");
    }
}
开发者ID:susom,项目名称:redcap-API-portal,代码行数:25,代码来源:config.php

示例15: session_start

<?php

session_start();
include 'globalfunctions.php';
$SessionId = $_POST['CLICKA_currentSessionId'];
$CurrentUserId = getSessionUser($SessionId);
$FormId = getSessionVar($SessionId, "currentlySelectedForm");
$getForm = $Mysql->query("SELECT * FROM forms WHERE Id='{$FormId}'");
$rsForm = $getForm->fetch_assoc();
$BackgroundColour = $rsForm['BackgroundColour'];
$FormBackground = $rsForm['FormBackground'];
$getFormInputs = $Mysql->query("SELECT * FROM forms_inputs WHERE FormId='{$FormId}' ORDER BY SortNum ASC");
?>
<script type="text/javascript">

function scriptLoaded() {

       $('#formChosen').modal('hide');

    document.getElementById('topbartext').innerHTML = "<button type=\"button\" class=\"btn btn-warning\" onclick=\"exitFormEntry()\" style=\"height:20px;padding-top:0px;\">Exit</button> Fill Out: <?php 
echo $rsForm['FormName'];
?>
"
    document.getElementById('sidenav').style.display="none"
    document.body.style.backgroundColor = "#<?php 
echo $BackgroundColour;
?>
";
    document.getElementById('page-wrapper').style.marginLeft="0px"
    document.getElementById('page-wrapper').style.backgroundColor="#<?php 
echo $BackgroundColour;
开发者ID:nzol,项目名称:roadshow,代码行数:31,代码来源:filloutform.php


注:本文中的getSessionUser函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。