public function login() { require 'camfoxconfig.php'; $username = $_REQUEST['username']; $password = $_REQUEST['userpassword']; $id = isUser($username, $password); if ($id > 0) { $last_login = get_last_login($id); $_SESSION['user_id'] = $id; //$_SESSION['last_login'] = $last_login; update_last_login_date($id); $user = checkUserAvailableEvents($_SESSION['user_id']); if ($user == 0) { insertUserintoEvents($_SESSION['user_id']); } else { updateUserinEvents($_SESSION['user_id']); } $_SESSION['new_event_count'] = $user[3]; $_SESSION['last_login'] = $user[2]; /* $email_id=getUserEmailById($id); //echo $email_id; $_SESSION['email_id'] = $email_id; $_SESSION['user_id'] = $id; $username = $_SESSION['email_id']; /* if(in_array($email_id,$hr_email)) header("Location:hr_panel.php"); else header("Location:home.php"); */ /* $pending_requests=get_my_pending_requests($_SESSION['email_id']); if((isset($_SESSION['first_time']) && $_SESSION['first_time'] =='yes') || $pending_requests == null || !is_approver($_SESSION['email_id'])) { $status=0; } else { $status=1; $_SESSION['first_time']='yes'; } if(in_array($email_id,$hr_email)) $this->http_response(2,200); else $this->http_response(1,200); */ $this->http_response($id, 200); } else { $message = "Incorrect Credentials"; $username = $_POST['username']; $password = $_POST['password']; // header("Location:index.php?error=$message&username=$username&password=$password"); $this->http_response(0, 200); } }
function print_user_panel($page) { echo "<h1>Welcome " . $_SESSION['name'] . "! Your last login was " . get_last_login($_SESSION['username']) . "</h1>\n <h2>Welcome to the User Panel</h2>\n Account Number: " . htmlspecialchars(get_accountNum($_SESSION['username'])) . "<br>\n Balance: " . htmlspecialchars(get_balance(get_accountNum($_SESSION['username']))) . "\n <br>\n <ul>\n <li><a href=\"/user/panel.php?page=transfer_money\">Transfer Money</a></li>\n <li><a href=\"/user/panel.php?page=transaction_history\">Transaction History</a></li>\n <li><a href=\"/user/panel.php?page=schedule_transfer\">Schedule Transfer</a></li>\n <li><a href=\"/user/panel.php?page=check_transfer_schedule\">Check Transfer Schedule</a></li>\n <li><a href=\"/user/panel.php?page=change_pin\">Change PIN</a></li>\n </ul>"; get_content($page); }
$user = get_userdatabylogin($login); update_usermeta($user->ID, 'last_login', current_time('mysql')); } function get_last_login($user_id) { $last_login = get_user_meta($user_id, 'last_login', true); $date_format = get_option('date_format') . ' ' . get_option('time_format'); $the_last_login = mysql2date($date_format, $last_login, false); echo $the_last_login; } add_action('wp_login', 'your_last_login'); // to display: global $userdata; get_currentuserinfo(); echo 'You last logged in:'; get_last_login($userdata->ID); // add "Read More" to the end of an excerpt function excerpt_readmore($more) { return '... <a href="' . get_permalink($post->ID) . '" class="readmore">' . 'Read More' . '</a>'; } add_filter('excerpt_more', 'excerpt_readmore'); // redirect to post if single result in category or tag function redirect_to_post() { global $wp_query; if (is_archive() && $wp_query->post_count == 1) { the_post(); $post_url = get_permalink(); wp_redirect($post_url); }
} ?> </p> <p><label>Status</label><?php echo $status; ?> </p> <p><label>Date Created</label><?php echo extract_date_time($date_created); ?> </p> <p><label>Last Login</label><?php $last_login = get_last_login($dbh, $username); if ($last_login) { echo extract_date_time($last_login); } else { echo "Never"; } ?> </p> <p><label>Last Case Activity</label><?php echo get_last_case_activity($dbh, $username); ?> </p> </div>
<section class="wrap wrap--content wrap--form wrap--shadow"> <h3 class="title title--section">Datos del usuario</h3> <?php wpdc_the_input_date('registro', date('d M Y H:i', strtotime($user->user_registered)), 'Fecha de registro', true); ?> <?php wpdc_the_input_date('last_login', date('d M Y H:i', strtotime(get_last_login($user->ID))), 'Último acceso', true); ?> <?php if (is_object($op_user)) { wpdc_the_input_number('karma', $op_user['karma'], 'Karma', 0, 999, true); } ?> <?php if (is_object($op_user)) { wpdc_the_input_number('invitations', $op_user['invitations'], 'Invitaciones', 0, 999, true); } ?> </section>
<div id = "home_nav" data-key = "<?php echo $_SESSION['private_key']; ?> "> <div id = "home_data"> <div><?php echo $_SESSION['first_name'] . ' ' . $_SESSION['last_name']; ?> </div> <?php include 'lib/php/auth/last_login.php'; include 'lib/php/utilities/convert_times.php'; $last_log = extract_date_time(get_last_login($dbh, $_SESSION['login'])); ?> <div class="small"> Last login: <?php echo $last_log; ?> </div> </div> <span class = "home_nav_choices"> <input type="radio" id="activity_button" name="radio" checked="checked" /><label for="activity_button">Activity</label> <input type="radio" id="upcoming_button" name="radio" /><label for="upcoming_button">Upcoming</label>