Ejemplo n.º 1
0
 public function actionLoginHistory()
 {
     $model = new LoginHistory();
     $model->unsetAttributes();
     $model->attributes = $this->aRequest('LoginHistory');
     $this->renderPartial('loginHistory', array('model' => $model));
 }
Ejemplo n.º 2
0
 protected function afterLogin($fromCookie)
 {
     $loginHistory = new LoginHistory();
     $loginHistory->user_id = $this->id;
     $loginHistory->ip = Yii::app()->request->getUserHostAddress();
     $loginHistory->date = time();
     $loginHistory->from_cookie = intval($fromCookie);
     $loginHistory->save(false);
 }
 public function loadModel($id)
 {
     $model = LoginHistory::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 4
0
 public function challenge()
 {
     global $cn;
     // DB読込み(メンバーテーブルから認証)
     $strSQL = "select a.member_id, a.login_pwd as pass, a.login_pwd_md5 as hashed_pass, a.pass_salt, a.name1, a.name2, a.disp_name, a.email, a.nickname, a.api_key, a.force_chpwd, a.login_ok_ymd " . "from v_member_header a " . "where login_id = '{$_REQUEST['email']}' ";
     $result = selectQuery($cn, $strSQL);
     if ($row = getRow($result)) {
         RCMSUser::setLogin($row, $_REQUEST['login_save']);
         LoginHistory::write($cn, RCMSUser::getUser());
         $_SESSION["password_inputted"] = 1;
         return array(true, $_REQUEST['login_save'] == 1);
     }
     return array(true, $_REQUEST['login_save'] == 1);
 }
Ejemplo n.º 5
0
/*********************************************************************************
 * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
 * ("License"); You may not use this file except in compliance with the 
 * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
 * Software distributed under the License is distributed on an  "AS IS"  basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 * The Original Code is:  SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
 * All Rights Reserved.
 ********************************************************************************/
require_once 'include/logging.php';
require_once 'modules/Users/LoginHistory.php';
require_once 'modules/Users/Users.php';
require_once 'config.php';
require_once 'include/database/PearDatabase.php';
global $adb, $current_user;
// Recording Logout Info
$usip = $_SERVER['REMOTE_ADDR'];
$outtime = date("Y/m/d H:i:s");
$loghistory = new LoginHistory();
$loghistory->user_logout($current_user->user_name, $usip, $outtime);
$local_log =& LoggerManager::getLogger('Logout');
// clear out the autthenticating flag
session_regenerate_id(true);
session_unset();
session_destroy();
define("IN_LOGIN", true);
// go to the login screen.
header("Location: index.php?action=Login&module=Users");
Ejemplo n.º 6
0
 if ($audit_trail == 'true') {
     if ($record == '') {
         $auditrecord = '';
     } else {
         $auditrecord = $record;
     }
     $date_var = $adb->formatDate(date('Y-m-d H:i:s'), true);
     $query = "insert into vtiger_audit_trial values(?,?,?,?,?,?)";
     $params = array($adb->getUniqueID('vtiger_audit_trial'), $focus->id, 'Users', 'Authenticate', '', $date_var);
     $adb->pquery($query, $params);
 }
 // Recording the login info
 $usip = $_SERVER['REMOTE_ADDR'];
 $intime = date("Y/m/d H:i:s");
 require_once 'modules/Users/LoginHistory.php';
 $loghistory = new LoginHistory();
 $Signin = $loghistory->user_login($focus->column_fields["user_name"], $usip, $intime);
 //Security related entries start
 require_once 'include/utils/UserInfoUtil.php';
 createUserPrivilegesfile($focus->id);
 //Security related entries end
 session_unregister('login_password');
 session_unregister('login_error');
 session_unregister('login_user_name');
 $_SESSION['authenticated_user_id'] = $focus->id;
 $_SESSION['app_unique_key'] = $application_unique_key;
 // store the user's theme in the session
 if (isset($_REQUEST['login_theme'])) {
     $authenticated_user_theme = $_REQUEST['login_theme'];
 } elseif (isset($_REQUEST['ck_login_theme'])) {
     $authenticated_user_theme = $_REQUEST['ck_login_theme'];
Ejemplo n.º 7
0
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
include "system.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
include "../class/LoginHistory.php";
include "../class/datepicker/class.datepicker.php";
$url = XOOPS_URL . "/modules/simantz";
$o = new LoginHistory();
$dp = new datepicker($url);
$dp->dateFormat = 'Y-m-d';
$action = $_POST['action'];
$o->activity = $_POST['activity'];
$o->datefrom = $_POST['datefrom'];
$o->dateto = $_POST['dateto'];
$o->showcalendarfrom = $dp->show("datefrom");
$o->showcalendarto = $dp->show("dateto");
if (isset($_POST['user_id'])) {
    $o->user_id = $_POST['user_id'];
} else {
    $o->user_id;
}
switch ($action) {
    case "search":
        $o->showSearchForm();
        $wherestring = $o->genWhereString($o->user_id, $o->activity, $o->datefrom, $o->dateto, $action);
        $o->showTable($wherestring, "ORDER BY e.eventdatetime DESC");
        break;
Ejemplo n.º 8
0
require_once 'modules/Users/LoginHistory.php';
require_once 'modules/Users/Users.php';
require_once 'include/logging.php';
require_once 'include/utils/utils.php';
global $app_strings;
global $mod_strings;
global $app_list_strings;
global $current_language, $current_user, $adb;
global $list_max_entries_per_page;
global $urlPrefix;
$log = LoggerManager::getLogger('login_list');
global $currentModule;
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$focus = new LoginHistory();
$smarty = new vtigerCRM_Smarty();
$category = getParenttab();
$userid = $_REQUEST['record'];
$username = getUserName($userid);
$qry = "Select * from vtiger_loginhistory where user_name= ?";
$qry_result = $adb->pquery($qry, array($username));
$no_of_rows = $adb->num_rows($qry_result);
//Retreiving the start value from request
if (isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
    $start = vtlib_purify($_REQUEST['start']);
} else {
    $start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $no_of_rows, '10');
Ejemplo n.º 9
0
 /**
  * Vrati cas posledneho prihlasenia
  * 
  * ak je to po 1 krat, tak vrati false
  * 
  * @return LoginHistory array
  */
 public function lastLogged()
 {
     $LoginHistory = new LoginHistory();
     // unbind all association
     $LoginHistory->recursive = -1;
     // ziskaj posledne prihlasenie
     $user_id = $_SESSION['User']['id'];
     $logins = $LoginHistory->findAll(array('user_id' => $user_id), array('login_time', 'ip'), 'login_time DESC', 2);
     if (count($logins) == 2) {
         return $logins[1]['LoginHistory'];
     } else {
         return false;
     }
 }
Ejemplo n.º 10
0
    $r2bdobj = new Rfq2Bids();
}
if (!isset($rfq2awardObj)) {
    include_once SITE_CLASS_APPLICATION . "user/class.Rfq2Award.php";
    $rfq2awardObj = new Rfq2Award();
}
// --- Statistics --------------------------------------------------------------------------------------------
// -----------
$sts = $statusmasterObj->getDetails(" DISTINCT iStatusID, vStatus_en, vStatus_fr, vStatus_" . LANG . " as vStatus ", " AND vForAuction LIKE '%RFQ2%'");
#pr($sts);exit;
$smarty->assign("sts", $sts);
// -----------------------------------------------------------------------------------------------------------
// --- Last Logins -------------------------------------------------------------------------------------------
if (!isset($lghObj)) {
    require_once SITE_CLASS_APPLICATION . "class.LoginHistory.php";
    $lghObj = new LoginHistory();
}
$lastlogins = $lghObj->getDetails("*", " AND iAdminId={$sess_id}", " dLoginDate DESC ", '', " LIMIT 0,3");
$lastLoginDate = $lastlogins[0]['dLoginDate'];
$smarty->assign("lastlogins", $lastlogins);
// INBOX DETAIL -----------------------------------------------------------------------------------------------------------
//Prints($_SESSION['SESS_'.PRJ_CONST_PREFIX.'_INBOX_VIEWED']);exit;
$curViewedInbox = isset($_SESSION['SESS_' . PRJ_CONST_PREFIX . '_INBOX_VIEWED']) ? $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_INBOX_VIEWED'] : '';
$curViewedInboxStr = @implode(',', $curViewedInbox);
if ($curViewedInboxStr != '') {
    $where .= ' AND iVerifiedID NOT IN(' . $curViewedInboxStr . ')';
}
$where .= ' AND ((eCreatedType = \'OU\' AND iCreatedBy <> \'' . $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID'] . '\') AND iOrganizationID=' . $curORGID . ') ';
// OR eCreatedType = \'OU\'
// $where .= ' AND (dActionDate > \''.$lastLoginDate.'\')';		// iCreatedBy <> '.$_SESSION['SESS_'.PRJ_CONST_PREFIX.'_ID'].' AND
$where .= ' AND iVerifiedID NOT IN (SELECT iInboxId FROM ' . PRJ_DB_PREFIX . '_user_deleted_inbox WHERE iUserId = \'' . $sess_id . '\' AND eUserType = \'' . $sess_usertype_short . '\') ';
Ejemplo n.º 11
0
$buttoncheck['Calendar'] = isPermitted('Calendar', 'index');
$freetag = new freetag();
$numberofcols = getNumberOfColumns();
$smarty->assign("CHECK", $buttoncheck);
if (vtlib_isModuleActive('Calendar')) {
    $smarty->assign("CALENDAR_ACTIVE", "yes");
}
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE", 'Home');
$smarty->assign("CATEGORY", getParenttab('Home'));
$smarty->assign("CURRENTUSER", $user_name);
$smarty->assign("ALL_TAG", $freetag->get_tag_cloud_html("", $current_user->id));
$smarty->assign("MAXLEN", $maxdiv);
$smarty->assign("ALLOW_RSS", $allow_rss);
$smarty->assign("ALLOW_DASH", $allow_dashbd);
$smarty->assign("ALLOW_REPORT", $allow_report);
$smarty->assign("HOMEFRAME", $homedetails);
$smarty->assign("MODULE_NAME", $modulenamearr);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("LAYOUT", $numberofcols);
$widgetBlockSize = PerformancePrefs::getBoolean('HOME_PAGE_WIDGET_GROUP_SIZE', 12);
$smarty->assign('widgetBlockSize', $widgetBlockSize);
// First time login check
include_once 'modules/Users/LoginHistory.php';
$accept_login_delay_seconds = 5 * 60;
// (use..5*60 for 5 min) to overcome redirection post authentication
$smarty->assign('FIRST_TIME_LOGIN', LoginHistory::firstTimeLoggedIn($current_user->user_name, $accept_login_delay_seconds));
// End
$smarty->display("Home/Homestuff.tpl");
Ejemplo n.º 12
0
        }
        if (!$isExternal) {
            header('Location: ' . $redirect);
            exit;
        }
    }
    header('Location: ' . XOOPS_URL . '/userinfo.php?uid=' . $xoopsUser->getVar('uid'));
    exit;
}
if ($op == 'logout') {
    $message = '';
    $_SESSION = array();
    // add for login history : 2010-07-24
    if ($xoopsUser) {
        include_once XOOPS_ROOT_PATH . "/modules/simantz/class/LoginHistory.php";
        $lh = new LoginHistory();
        $lh->insertEventRecord($xoopsUser->getVar('uid'), "O");
        echo "ASDS";
    }
    //end
    session_destroy();
    setcookie($xoopsConfig['usercookie'], 0, -1, '/', XOOPS_COOKIE_DOMAIN, 0);
    setcookie($xoopsConfig['usercookie'], 0, -1, '/');
    // clear entry from online users table
    if (is_object($xoopsUser)) {
        $online_handler =& xoops_gethandler('online');
        $online_handler->destroy($xoopsUser->getVar('uid'));
    }
    $message = _US_LOGGEDOUT . '<br />' . _US_THANKYOUFORVISIT;
    redirect_header('index.php', 1, $message);
    exit;
Ejemplo n.º 13
0
     $allowed = false;
     foreach ($user->getGroups() as $group) {
         if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
             $allowed = true;
             break;
         }
     }
     if (!$allowed) {
         redirect_header(XOOPS_URL . '/index.php', 1, _NOPERM);
         exit;
     }
 }
 $user->setVar('last_login', time());
 //modify by kstan@simit.com.my 2009-07-24 for trace login event
 include_once XOOPS_ROOT_PATH . "/modules/simantz/class/LoginHistory.php";
 $lh = new LoginHistory();
 $lh->insertEventRecord($user->getVar("uid"), "I", "r");
 // (uid,insert,killprevioussession/reserveprevioussession)
 //end modifcation kstan@simit.com.my 2009-06-23
 if (!$member_handler->insertUser($user)) {
 }
 // Regenrate a new session id and destroy old session
 $GLOBALS["sess_handler"]->regenerate_id(true);
 $_SESSION = array();
 $_SESSION['xoopsUserId'] = $user->getVar('uid');
 $_SESSION['xoopsUserGroups'] = $user->getGroups();
 $user_theme = $user->getVar('theme');
 if (in_array($user_theme, $xoopsConfig['theme_set_allowed'])) {
     $_SESSION['xoopsUserTheme'] = $user_theme;
 }
 // Set cookie for rememberme
Ejemplo n.º 14
0
 /**
  * Attempt to do login
  *
  */
 public function do_login()
 {
     $input = array('email' => Input::get('email'), 'username' => Input::get('email'), 'password' => Input::get('password'), 'remember' => Input::get('remember'));
     // If you wish to only allow login from confirmed users, call logAttempt
     // with the second parameter as true.
     // logAttempt will check if the 'email' perhaps is the username.
     // Get the value from the config file instead of changing the controller
     if (Confide::logAttempt($input, Config::get('confide::signup_confirm'))) {
         // Redirect the user to the URL they were trying to access before
         // caught by the authentication filter IE Redirect::guest('user/login').
         // Otherwise fallback to '/'
         // Fix pull #145
         $user = Confide::user();
         $ip = $this->get_client_ip();
         $this->sendMailIPUser($user, $ip);
         User::where('id', $user->id)->update(array('lastest_login' => date("Y-m-d H:i:s"), 'ip_lastlogin' => $ip));
         $login_history = new LoginHistory();
         $login_history->user_id = $user->id;
         $login_history->ip_address = $ip;
         $login_history->date = date("Y-m-d H:i:s");
         $login_history->save();
         if (Input::get('isAjax')) {
             echo 1;
             exit;
         } else {
             if (User::find($user->id)->hasRole('Admin')) {
                 return Redirect::to('admin');
             } else {
                 return Redirect::to('user/profile')->with('notice', "Welcome to EcoinsTrader. You can now start Trading.");
             }
             // change it to '/admin', '/dashboard' or something
         }
     } else {
         $user = new User();
         // Check if there was too many login attempts
         if (Confide::isThrottled($input)) {
             $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
         } elseif ($user->checkUserExists($input) and !$user->isConfirmed($input)) {
             $err_msg = Lang::get('confide::confide.alerts.not_confirmed');
         } else {
             $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
         }
         if (Input::get('isAjax')) {
             echo $err_msg;
             exit;
         } else {
             return Redirect::action('UserController@login')->withInput(Input::except('password'))->with('error', $err_msg);
         }
     }
 }
 public function deleteUSer()
 {
     $user_id = Input::get('user_id');
     $user = User::find($user_id);
     if (isset($user->id)) {
         DB::table('users_roles')->where('user_id', $user_id)->delete();
         UserInformation::where("user_id", $user_id)->delete();
         UserAddressDeposit::where("user_id", $user_id)->delete();
         Balance::where("user_id", $user_id)->delete();
         LoginHistory::where("user_id", $user_id)->delete();
         Deposit::where("user_id", $user_id)->delete();
         Withdraw::where("user_id", $user_id)->delete();
         Order::where('user_id', $user_id)->delete();
         //ko nen xoa transfer va trade vi no gan voi 1 user nhan/user mua(ban), nen neu xoa thi se xoa luon lich su cua nguoi khac
         User::where('id', $user_id)->delete();
         $message = $user->username . " " . Lang::get('admin_messages.delete_success');
         if (Input::get('isAjax')) {
             echo json_encode(array('status' => 'success', 'message' => $message));
             exit;
         } else {
             return Redirect::to('admin/manage/users')->with('success', $message);
         }
     } else {
         $message = Lang::get('admin_messages.user_not_exist');
         if (Input::get('isAjax')) {
             echo json_encode(array('status' => 'error', 'message' => $message));
             exit;
         } else {
             return Redirect::to('admin/manage/users')->with('error', $message);
         }
     }
 }