本文整理汇总了PHP中isValidUser函数的典型用法代码示例。如果您正苦于以下问题:PHP isValidUser函数的具体用法?PHP isValidUser怎么用?PHP isValidUser使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isValidUser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$this->load->model('User_Model', '', TRUE);
$this->load->model('Usermodel', '', TRUE);
$this->load->model('Userprofile', '', TRUE);
if (isValidUser()) {
$user = $this->User_Model->get_user_by_id(getUserProperty('id'));
} else {
redirect("", "location");
return;
}
// Process form
if (!empty($_POST)) {
$profile_data = array('notifications' => $this->input->post('notifications'));
$user_data = array('user_name' => $this->input->post('phone'));
if (!empty($_POST['password'])) {
$user_data['password'] = $this->freakauth_light->_encode($this->input->post('password'));
}
$this->Userprofile->updateUserProfile(getUserProperty('id'), $profile_data);
$this->User_Model->update_user_by_id(getUserProperty('id'), $user_data);
$this->db_session->set_flashdata('success', 'You have updated your account information');
redirect('/profile');
}
$this->load->view('templates/header', $user);
$this->load->view('user/profile', $user);
$this->load->view('templates/footer');
}
示例2: displayMenu
function displayMenu($config)
{
//Menu Items
echo '<h2>Main Menu</h2>';
echo '<ul>';
echo '<li><a href="' . $_SERVER['PHP_SELF'] . '" >Home</a></li>';
echo '<li><a href="https://mail.mahoningcountyoh.gov" target="_blank">County E-Mail</a></li>';
echo '<li><a href="https://mcso-training.mahoningsheriff.com" target="_blank">Sheriff Training</a></li>';
echo '<li><a href="http://mcso-techsupport.mahoningcountyoh.gov/portal" target="_blank">Technical Support</a></li>';
echo '<li><a href="http://connect.mahoningcountyoh.gov" target="_blank">Remote Support</a></li>';
echo '<li><a href="https://aii.mahoningcountyoh.gov" target="_blank">Agency View Website</a></li>';
echo '<li><a href="http://lodge141.com" target="_blank">Lodge141 Website</a></li>';
echo '</ul>';
if (isValidUser($config)) {
echo '<h2>User Menu</h2>';
echo '<ul>';
echo '<li><a href="?updateProfile=true">Update Profile</a></li>';
if ($_SESSION['isLDAP'] == false) {
echo '<li><a href="?usermenu=true&ChangeBtn=true">Change Your Password</a><br /><br />';
}
echo '<li><a href="?secLog=true">Secondary Logs</a></li>';
//if($config->adminLvl >= 25)
echo '<li><a href="?radioLog=true">Inventory Checkout Logs</a></li>';
//echo '<li><a href="?leave=true">Request Form</a></li>';
echo '<li><a href="?isTimeRequestForm=true">Time Request Form</a></li>';
echo '<li><a href="?myReq=true">My Submitted Requests</a></li>';
echo '<li><a href="?myInv=true">My Inventory</a></li>';
}
echo '</ul>';
displaySupv($config);
displayAcct($config);
displayAdmin($config);
}
示例3: myAlerts
function myAlerts($config)
{
if (isValidUser($config)) {
//popUpMessage('You have an Alert! <a href="?approve=true">Go To Request</a>');
}
alert_VerifyUsers($config);
alert_PostPayrollValidation($config);
}
示例4: main
function main($itsp)
{
include "dwoo/dwooAutoload.php";
$valid = isValidUser();
if ($valid) {
$tpl = new Dwoo_Template_File('templates/newedittask.tpl');
$this->dwoo = new Dwoo();
$jsfiles = array();
$jsfiles[] = array('jsfile' => 'js/newtask.js');
$jsfiles[] = array('jsfile' => 'js/tiny_mce/jquery.tinymce.js');
$jsfiles[] = array('jsfile' => 'js/tinymce.js');
include_once "urls_backend.php";
$urls = new urls_backend();
$currenttask = $urls->getGP("__taskid");
include_once "tasks_backend.php";
$tasks = new tasks_backend();
$submiturl = $_SERVER["HTTP_REFERER"];
$parent = $tasks->getParent($currenttask);
while ($parent["id"] > 0) {
$params = array();
$params["task"] = $parent["title"];
$params["__taskid"] = $parent["id"];
$breadcrumburl = $urls->newUrl("tasks", $params);
$m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => '' . htmlentities($parent["title"]) . '', 'sepstart' => '» ');
$parent = $tasks->getParent($parent["pid"]);
}
$params = array();
$breadcrumburl = $urls->newUrl("tasks", $params);
$m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => 'Main');
$m_list = array_reverse($m_list);
$markerArray = loggedInArray();
$markerArray["tasktitle"] = $tasks->getTaskInfo($currenttask, "title", 1);
$markerArray["taskdescription"] = $tasks->getTaskInfo($currenttask, "description", 1);
$markerArray["js_list"] = $jsfiles;
$markerArray["taskid"] = $currenttask;
$markerArray["submiturl"] = $submiturl;
$markerArray["func"] = "update";
$progress = $tasks->getTaskInfo($currenttask, "progress");
$markerArray["p" . $progress] = "selected";
$markerArray["submitbtn"] = $itsp->bLang->getLL("page.tasks.updatetask");
$markerArray["m_list"] = $m_list;
$markerArray["headertitle"] = $tasks->getTaskInfo($currenttask, "title");
$markerArray["selectedtask"] = $itsp->bLang->getLL("page.tasks.selectedtask");
$markerArray["tasktitletxt"] = $itsp->bLang->getLL("page.tasks.tasktitle");
$markerArray["taskdescriptiontxt"] = $itsp->bLang->getLL("page.tasks.description");
$markerArray["taskprogress"] = $itsp->bLang->getLL("page.tasks.progress");
$markerArray["tasknotstarted"] = $itsp->bLang->getLL("page.tasks.notstarted");
$markerArray["taskfinished"] = $itsp->bLang->getLL("closed");
$output = $this->dwoo->get($tpl, $markerArray);
print $output;
} else {
print "access denied";
}
}
示例5: index
function index()
{
log_message('error', 'test');
if (isValidUser()) {
$this->load->view('templates/header');
$this->load->view('templates/welcome');
$this->load->view('templates/footer');
} else {
redirect('', 'location');
}
}
示例6: test
public function test()
{
$this->load->model('usermodel');
$this->load->model('budget');
if (isValidUser()) {
$data['page'] = $this->load->view("dev/test", null, true);
$this->load->view($this->container, $data);
} else {
$this->unAuthorizeduser();
}
}
示例7: main
function main($itsp)
{
$itsp->bLang->setLanguage($_GET["lang"]);
$valid = isValidUser();
if ($valid) {
logoutUser();
include_once "urls_backend.php";
$urls = new urls_backend();
$params = array();
$logouturl = $urls->newUrl("frontpage", $params);
print '<META HTTP-EQUIV="Refresh" Content = "0;URL=' . config::basehref . '">';
} else {
print "access denied";
}
}
示例8: login
function login()
{
if (isValidUser() == false) {
$this->data['title'] = "Login";
//validate form input
$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
if ($this->form_validation->run() == true) {
//check to see if the user is logging in
//check for "remember me"
$remember = (bool) $this->input->post('remember');
if ($this->ion_auth->login($this->input->post('username'), $this->input->post('password'), $remember)) {
//if the login is successful
//redirect them back to the home page
$this->session->set_flashdata('message', $this->ion_auth->messages());
redirect(base_url(), 'refresh');
} else {
//if the login was un-successful
//redirect them back to the login page
$this->session->set_flashdata('message', $this->ion_auth->errors());
redirect(base_url() . 'auth/login', 'refresh');
//use redirects instead of loading views for compatibility with MY_Controller libraries
}
} else {
//the user is not logging in so display the login page
//set the flash data error message if there is one
$this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
/*
$this->data['identity'] = array('name' => 'identity',
'id' => 'identity',
'type' => 'text',
'value' => $this->form_validation->set_value('username'),
);
$this->data['password'] = array('name' => 'password',
'id' => 'password',
'type' => 'password',
);
$this->_render_page('auth/login', $this->data);
*
*/
$data['page'] = $this->load->view('login', $this->data, true);
$this->load->view($this->container, $data);
}
} else {
redirect(base_url(), 'location');
}
}
示例9: index
function index()
{
$this->load->model('User_Model', '', TRUE);
$this->load->model('Plan_Model', '', TRUE);
$this->load->model('Gram_Model', '', TRUE);
$this->load->model('Message_Model', '', TRUE);
if (isValidUser()) {
$user = $this->User_Model->get_user_by_id(getUserProperty('id'));
} else {
redirect("", "location");
return;
}
$messages = $this->Message_Model->get_messages_by_user_id($user["user_id"]);
$this->load->view('templates/header', array("user" => $user));
$this->load->view('dashboard/stats', array("messages" => $messages));
$this->load->view('templates/footer');
}
示例10: main
function main($itsp)
{
$itsp->bLang->setLanguage($_GET["lang"]);
include_once "dwoo/dwooAutoload.php";
$valid = isValidUser();
if ($valid) {
$tpl = new Dwoo_Template_File('templates/home.tpl');
$dwoo = new Dwoo();
$markerArray = loggedInArray();
$output = $dwoo->get($tpl, $markerArray);
print $output;
} else {
$tpl = new Dwoo_Template_File('templates/frontpage.tpl');
$dwoo = new Dwoo();
$markerArray = templateArray();
$markerArray["loginerror"] = "Failed to login";
$output = $dwoo->get($tpl, $markerArray);
print $output;
}
}
示例11: main
function main($itsp)
{
include "dwoo/dwooAutoload.php";
if ($itsp->bUrl->getGP("s")) {
user_backend::verifyUser($itsp->bUrl->getGP("s"), $itsp->bUrl->getGP("u"), 1);
}
$valid = isValidUser();
if ($valid) {
$tpl = new Dwoo_Template_File('templates/verifieduser.tpl');
$dwoo = new Dwoo();
$params = array();
$homeurl = "/" . config::installpath . "" . $itsp->bUrl->newUrl("tasks", $params);
$markerArray = loggedInArray();
$markerArray["pageVerifiedUserAccepted"] = $itsp->bLang->getLL("page.verifieduser.useraccepted");
$markerArray["pageVerifiedUserHomeUrl"] = $itsp->bLang->getLL("page.verifieduser.homeurl");
$markerArray["homeUrl"] = $homeurl;
$output = $dwoo->get($tpl, $markerArray);
print $output;
} else {
print "access denied";
}
}
示例12: index
function index()
{
$this->load->model('User_Model', '', TRUE);
$this->load->model('Plan_Model', '', TRUE);
$this->load->model('Gram_Model', '', TRUE);
if (!isValidUser()) {
$data['fal'] = $this->fal_front->register();
$this->load->view('templates/header');
$this->load->view('templates/home', $data);
} else {
$first_use = false;
$user = $this->User_Model->get_user_by_id(getUserProperty('id'));
if ($user["welcome_message_seen"] == 0) {
$first_use = true;
}
$this->load->view('templates/header', array("user" => $user));
$plan = $this->Plan_Model->get_plan_by_user_id(getUserProperty('id'));
//echo "<pre>Plan: ".print_r($plan, true)."</pre>\n";
$grams = $this->Gram_Model->get_grams_by_plan_id($plan["plan_id"]);
//echo "<pre>Grams: ".print_r($grams, true)."</pre>\n";
$this->load->view('dashboard/main', array("grams" => $grams, "first_use" => $first_use));
}
$this->load->view('templates/footer');
}
示例13: displayUsers
function displayUsers()
{
/*
* Shows all users and gives the option to edit any fields
*/
$admin = $_SESSION['admin'];
if ($admin >= 50 && isValidUser()) {
$mysqli = connectToSQL();
$myq = "SELECT *\r\n FROM EMPLOYEE";
$result = $mysqli->query($myq);
if (!$result) {
throw new Exception("Database Error [{$mysqli->errno}] {$mysqli->error}");
}
//build table
resultTable($mysqli, $result);
//write any updates to DB when Save is pressed
if (isset($_POST['saveBtn'])) {
//saveBtn created in resultTable()
$result = $mysqli->query($myq);
$i = 0;
$fieldNameArray = array();
$values = array();
while ($finfo = mysqli_fetch_field($result)) {
$tableName = $finfo->orgtable;
$fieldNameArray[$i] = $finfo->orgname;
$values["{$fieldNameArray[$i]}"] = $fieldNameArray[$i] . "=" . "'" . $mysqli->real_escape_string($_POST["{$fieldNameArray[$i]}"]) . "'";
$i++;
}
//turn the array into comma seperated values
$csvValues = implode(',', $values);
$updateQuery = "UPDATE " . $tableName . " SET " . $csvValues . " \r\n WHERE " . $values['ID'];
echo "<br>" . $updateQuery;
$updateResult = $mysqli->query($updateQuery);
if (!$updateResult) {
throw new Exception("Database Error [{$mysqli->errno}] {$mysqli->error}");
}
}
}
}
示例14: displayRequestLookup
function displayRequestLookup($config)
{
$totalRows = isset($_POST['totalRows']) ? $_POST['totalRows'] : '';
$foundUserFNAME = '';
$foundUserLNAME = '';
$foundUserName = '';
$foundUserID = '';
if ($totalRows > 0) {
//get post info providied from search results
for ($i = 1; $i <= $totalRows; $i++) {
if (isset($_POST['foundUser' . $i])) {
$foundUserFNAME = $_POST['foundUserFNAME' . $i];
$foundUserLNAME = $_POST['foundUserLNAME' . $i];
$foundUserName = $_POST['foundUserName' . $i];
$foundUserID = $_POST['foundUserID' . $i];
if (isset($_POST['isReserve' . $i])) {
echo '<input type="hidden" name="isReserve" value="true" />';
}
break;
}
//end if
}
//end for
}
if (isValidUser($config) && (isset($_POST['lname']) || isset($_POST['editBtn']))) {
if (isset($_POST['lname'])) {
$lname = $_SESSION['lname'] = strtoupper($_POST['lname']);
$startDate = $_SESSION['start'] = new DateTime($_POST['start']);
$endDate = $_SESSION['end'] = new DateTime($_POST['end']);
} else {
$lname = $_SESSION['lname'];
$startDate = $_SESSION['start'];
$endDate = $_SESSION['end'];
}
$mysqli = $config->mysqli;
//query for all time requests if no date selected
if (!empty($_POST['start']) && !empty($_POST['end'])) {
$myq = "SELECT DISTINCT REFER 'RefNo', CONCAT_WS(', ', REQ.LNAME, REQ.FNAME) 'Employee', DATE_FORMAT(REQDATE,'%a %b %d %Y') 'Requested',\r\n DATE_FORMAT(USEDATE,'%a %b %d %Y') 'Used', BEGTIME 'Start',\r\n ENDTIME 'End', HOURS 'Hrs',\r\n T.DESCR 'Type', SUBTYPE 'Subtype', CALLOFF 'Calloff', NOTE 'Comment', STATUS 'Status', \r\n APR.LNAME 'ApprovedBy', REASON 'Reason' \r\n FROM REQUEST R\r\n INNER JOIN TIMETYPE AS T ON R.TIMETYPEID=T.TIMETYPEID\r\n LEFT JOIN EMPLOYEE AS REQ ON REQ.IDNUM=R.IDNUM\r\n LEFT JOIN EMPLOYEE AS APR ON APR.IDNUM=R.APPROVEDBY\r\n WHERE USEDATE BETWEEN '" . $config->mysqli->real_escape_string($startDate->format('Y-m-d')) . "' \r\n AND '" . $config->mysqli->real_escape_string($endDate->format('Y-m-d')) . "' \r\n AND REQ.LNAME LIKE '%" . $config->mysqli->real_escape_string($lname) . "%'";
} else {
$myq = "SELECT DISTINCT REFER 'RefNo', CONCAT_WS(', ', REQ.LNAME, REQ.FNAME) 'Employee', DATE_FORMAT(REQDATE,'%a %b %d %Y') 'Requested',\r\n DATE_FORMAT(USEDATE,'%a %b %d %Y') 'Used', BEGTIME 'Start',\r\n ENDTIME 'End', HOURS 'Hrs',\r\n T.DESCR 'Type', SUBTYPE 'Subtype', CALLOFF 'Calloff', NOTE 'Comment', STATUS 'Status', \r\n APR.LNAME 'ApprovedBy', REASON 'Reason' \r\n FROM REQUEST R\r\n INNER JOIN TIMETYPE AS T ON R.TIMETYPEID=T.TIMETYPEID\r\n LEFT JOIN EMPLOYEE AS REQ ON REQ.IDNUM=R.IDNUM\r\n LEFT JOIN EMPLOYEE AS APR ON APR.IDNUM=R.APPROVEDBY \r\n WHERE REQ.LNAME LIKE '%" . $config->mysqli->real_escape_string($lname) . "%'";
}
//popUpMessage($myq); //DEBUG
$result = $mysqli->query($myq);
SQLerrorCatch($mysqli, $result);
resultTable($mysqli, $result);
echo "<a href='" . $_SERVER['REQUEST_URI'] . "'>Back to Search</a>";
} else {
?>
<form name="lookup" method="post" action="<?php
echo $_SERVER['REQUEST_URI'];
?>
">
<input type="hidden" name="formName" value="lookup" />
<input type="hidden" name="searchReserves" value="false" />
<h1>Lookup Requests by Employee</h1>
<p>Search by last name:
<input type="text" name="lname" value="<?php
echo $foundUserLNAME;
?>
" /> or <?php
displayUserLookup($config);
?>
</p>
<p>Date range: From <?php
displayDateSelect('start', 'date_1');
?>
to <?php
displayDateSelect('end', 'date_2');
?>
</p>
<p>(Leave date range blank to show requests for all time.)</p>
<p><input type="submit" name="Submit" value="Search"></p>
</form>
<?php
}
}
示例15: main
function main($itsp)
{
include "dwoo/dwooAutoload.php";
$valid = isValidUser();
if ($valid) {
include_once "urls_backend.php";
$urls = new urls_backend();
include_once "tasks_backend.php";
$tasks = new tasks_backend();
$this_url = "http://" . $_SERVER["SERVER_NAME"] . "" . $_SERVER["REQUEST_URI"];
if ($_POST["func"] == "create") {
$_pid = $urls->getGP("__taskid");
$_title = $_POST["tasktitle"];
$_description = $_POST["taskdescription"];
$tasks->createNewTask($_pid, $_title, $_description);
header("Location: {$this_url}#", TRUE, 302);
exit;
}
if ($_POST["func"] == "update" && !isset($_POST["delete"])) {
$_id = $_POST["taskid"];
$_title = $_POST["tasktitle"];
$_description = $_POST["taskdescription"];
$tasks->updateTask($_id, $_title, $_description);
$tasks->setField($_id, "progress", $_POST["taskprogress"]);
header("Location: {$this_url}#", TRUE, 302);
exit;
}
if (isset($_POST["delete"])) {
$_id = $_POST["taskid"];
$tasks->setField($_id, "deleted", 1);
header("Location: {$this_url}#", TRUE, 302);
exit;
}
$tpl = new Dwoo_Template_File('templates/tasks.tpl');
$this->dwoo = new Dwoo();
$currenttask = $urls->getGP("__taskid");
$currenttitle = $urls->getGP("task");
$jsfiles = array();
$jsfiles[] = array('jsfile' => 'js/jquery-ui-1.8.4.custom.min.js');
$jsfiles[] = array('jsfile' => 'js/tasklist.php?t=' . $currenttask);
$jsfiles[] = array('jsfile' => 'js/widgetTreeList.js');
$tasklist = $this->getSubTasks(0, 0);
$markerArray = array();
$markerArray["ulid"] = "";
$markerArray["ulclass"] = "newul";
$markerArray = loggedInArray();
$markerArray["js_list"] = $jsfiles;
$_tasks = $this->getSubTasks($currenttask ? $currenttask : 0, 0, 99);
$_closedtasks = $this->getSubTasks($currenttask ? $currenttask : 0, 0, 100, "=");
$m_list = array();
$getParent = 1;
$parent = $tasks->getParent($currenttask);
while ($parent["id"] > 0) {
$params = array();
$params["task"] = $parent["title"];
$params["__taskid"] = $parent["id"];
$breadcrumburl = $urls->newUrl("tasks", $params);
$m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => '' . $parent["title"] . '', 'sepstart' => '» ');
$parent = $tasks->getParent($parent["pid"]);
}
$params = array();
$breadcrumburl = $urls->newUrl("tasks", $params);
$m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => 'Main');
$m_list = array_reverse($m_list);
$p_list = array();
$openmsg = $itsp->bLang->getLL("open");
$closedmsg = $itsp->bLang->getLL("closed");
$toggleinfomsg = $itsp->bLang->getLL("page.tasks.toggleinfo");
$movethismsg = $itsp->bLang->getLL("page.tasks.movethis");
$dontmovethismsg = stripslashes($itsp->bLang->getLL("page.tasks.dontmovethis"));
$user = new user_backend();
$moveableTasks = unserialize($user->getUserSetting("movingTasks"));
$moveherevisible = "show";
if ($moveableTasks == "") {
$moveherevisible = "hide";
}
if (count($moveableTasks) < 1) {
$moveherevisible = "hide";
}
foreach ($_tasks as $key => $value) {
$params = array();
$params["task"] = $currenttitle . "/" . $value["title"];
$params["__taskid"] = $value["id"];
$taskurl = $urls->newUrl("tasks", $params);
$edittaskurl = $urls->newUrl("edittask", $params);
$subtasks = $tasks->getNumberOfSubTasks($value["id"]);
$opensubtasks = $tasks->getNumberOfSubTasks($value["id"], 100);
$status = $tasks->getTaskInfo($value["id"], "progress");
if ($status < 100) {
$status = $openmsg;
} else {
$status = $closedmsg;
}
$created = $tasks->getTaskInfo($value["id"], "crdate");
if ($created > 0) {
$created = date("d.m.Y", $created);
} else {
$created = "N/A";
}
$toggleonoff = "strike nolink";
//.........这里部分代码省略.........