Esempio n. 1
0
 public function unblockUser($user)
 {
     $log = new AdminLogin();
     if ($log->unblock($user) === true) {
         echo "Account unblocked successfully";
     }
 }
Esempio n. 2
0
 public function actionIndex()
 {
     $form = new AdminLogin();
     if (isset($_POST['AdminLogin'])) {
         $form->setAttributes($_POST['AdminLogin']);
         if ($form->validate()) {
             Yii::app()->user->login($form->identity);
             AdminUser::model()->deleteAll('userid=:id', array(':id' => Yii::app()->user->id));
             // Update admin login table
             $admin = new AdminUser();
             $admin->save();
             // Add to session the last time we clicked
             Yii::app()->session['admin_clicked'] = time();
             fok(at('Thank You! You are now logged in.'));
             // Add to login history
             AdminLoginHistory::model()->addLog($_POST['AdminLogin']['email'], $_POST['AdminLogin']['password'], 1);
             // Log Message
             alog(at("User logged in."));
             // Update last visited
             User::model()->updateByPk(Yii::app()->user->id, array('last_visited' => time()));
             $returnUrl = Yii::app()->request->getUrl();
             if (strpos($returnUrl, yiiparam('adminUrl') . '?r=login') !== false) {
                 $returnUrl = array('/');
             }
             $this->redirect($returnUrl);
         } else {
             ferror(at('Sorry, There were errors with the information provided.'));
             // Add to login history
             AdminLoginHistory::model()->addLog($_POST['AdminLogin']['email'], $_POST['AdminLogin']['password'], 0);
         }
     }
     $this->render('login', array('form' => $form));
 }
Esempio n. 3
0
 function sendTellAFriend($argArrPost)
 {
     $objValidation = new Validate_fields();
     $objCore = new Core();
     $objGeneral = new General();
     $objValidation->check_4html = false;
     $objValidation->add_text_field('To', strip_tags($argArrPost['email']), 'text', 'y');
     $objAdminLogin = new AdminLogin();
     $arrAdminInfo = $objAdminLogin->getAdminInfo($varWhere);
     $varToAdmin = $arrAdminInfo[0]['AdminEmail'];
     $varFrom = SITE_NAME . '<' . $varToAdmin . '>';
     if ($objValidation->validation()) {
         $errorMsgFirst = 'Please enter required fields!';
     } else {
         $errorMsg = $objValidation->create_msg();
     }
     //Checking for Error.
     if ($errorMsg) {
         // Save Data into Session variable.
         $objCore->setErrorMsg($errorMsg);
         header("location: " . $argArrPost['reUrl']);
         exit;
     } else {
         if (!empty($argArrPost['yourname'])) {
             $subject = $argArrPost['yourname'] . $subject;
         } else {
             $subject = 'Somebody' . $subject;
         }
         $message = "Please visit this page: " . SITE_ROOT_URL . "\n\n";
         if (!empty($argArrPost['yourname'])) {
             $message .= "This link was sent to you by: " . $argArrPost['yourname'];
             if (!empty($argArrPost['youremail'])) {
                 $message .= " - " . $argArrPost['youremail'] . "\n\n";
             }
             if (!empty($argArrPost['message'])) {
                 $message .= "Message:" . "\n" . $argArrPost['message'];
             }
         }
         //echo $message;die;
         $objCore->sendMail(ucwords($to), $varFrom, $subject, $message);
         $objCore->setSuccessMsg(ADMIN_TELLFRIEND_SEND_MAIL_SUCCESS_MSG);
         return true;
     }
 }
Esempio n. 4
0
<?php

require_once '../common/config/config.inc.php';
require_once SOURCE_ROOT . 'classes/class.client.php';
require_once SOURCE_ROOT . 'classes/class.paging.php';
require_once SOURCE_ROOT . 'classes/class.sort.php';
require_once SOURCE_ROOT . '/classes/class.adminlogin.php';
require_once SOURCE_ROOT . '/classes/excelwriter.php';
$objAdminLogin = new AdminLogin();
$objAdminLogin->isValidAdmin();
$objSessionRedirectUrl = new SessionRedirectUrl();
$objClients = new Clients();
$objPaging = new Paging();
//$varPageStart = $objPaging->getPageStartLimit($_GET['page'], $_SESSION['sessAdminPagingLimit']);
//$varLimit = $varPageStart.','.$_SESSION['sessAdminPagingLimit'];
$arrUsersFlds = array('pkClientID', 'ClientLoginID', 'ClientFirstName', 'ClientLastName', 'ClientPassword', 'ClientOrganizationName', 'ClientStreetAddress', 'ClientCity', 'ClientState', 'ClientZipCode', 'ClientPhoneNumber', 'ClientOrganizationType', 'ClientAddedDate', 'ClientModifiedDate', 'ClientApprovalStatus');
//$varPageStart = $objPaging->getPageStartLimit($_GET['page'], $_SESSION['sessAdminPagingLimit']);
//$varLimit = $varPageStart.','.$_SESSION['sessAdminPagingLimit'];
//$arrUsersRecord = $objGeneral->getRecord(TABLE_CLIENTS, $arrUsersFlds, '');
//$NumberofRows = count($arrUsersRecord);
//$varNumberPages = $objPaging->calculateNumberofPages($NumberofRows, $_SESSION['sessAdminPagingLimit']);
$arrUsersList = $objClients->getUsersList(TABLE_CLIENTS, $arrUsersFlds, $varLimit, '');
//print_r($arrproperty_surveyList);die;
$excel = new ExcelWriter("client_list.xls");
if ($excel == false) {
    echo $excel->error;
}
$main_array = array("<b>Client ID</b>", "<b>E-mail ID</b>", "<b>First Name</b>", "<b>Last Name</b>", "<b>Password</b>", "<b>Organization Name</b>", "<b>Street Address</b>", "<b>City</b>", "<b>State</b>", "<b>Zip</b>", "<b>Phone</b>", "<b>Organization Type</b>", "<b>Date Added</b>", "<b>Date Modified</b>", "<b>Status</b>");
$columnTitles = array_values($main_array);
$numColumns = count($columnTitles);
// $row += 2;
Esempio n. 5
0
<?php

require_once '../common/config/config.inc.php';
require_once SOURCE_ROOT . 'classes/class.adminlogin.php';
require_once SOURCE_ROOT . 'classes/class.extra.php';
$objExtra = new Extra();
$objAdminLogin = new AdminLogin();
$objAdminLogin->isValidAdmin();
$varWhr = "AND AdminUserName = '" . $_SESSION['sessAdminUserName'] . "'";
$arrResult = $objAdminLogin->getAdminEmail($varWhr);
$arrClmn = array('pkExtraID', 'ClientExtra1', 'ClientExtra2', 'NicheExtra1', 'NicheExtra2', 'UrnsExtra1', 'UrnsExtra2');
$extra = $objExtra->getExtraListing(TABLE_EXTRA_SETTINGS, $arrClmn, '');
//var_dump($extra[0]['pkExtraID']);die;
//var_dump($extra[0]);die;
if ($_SESSION["arrPost"] != '') {
    @extract($_SESSION["arrPost"]);
    $varAdminEmail = $frmAdminEmail;
    $varAdminSupportEmail = $frmSupportEmail;
}
if ($arrResult) {
    $varAdminEmail = $arrResult[0]['AdminEmail'];
    $varAdminSupportEmail = $arrResult[0]['AdminSupportEmail'];
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
Esempio n. 6
0
<?php

require_once '../common/config/config.inc.php';
require_once SOURCE_ROOT . 'components/class.validation.inc.php';
require_once SOURCE_ROOT . 'classes/class.adminlogin.php';
$objAdminLogin = new AdminLogin();
$objAdminLogin->isValidAdmin();
if (isset($_POST['btnResetPassword'])) {
    if ($objAdminLogin->resetPassword($_POST)) {
        header('location:reset_password.php?op=result');
        exit;
    } else {
        header('location:reset_password.php?mid=' . $_POST['frmMember'] . '&code=' . $_POST['frmCode']);
        exit;
    }
}
Esempio n. 7
0
              <h4>Gangouts</h4>
              <span class="text-muted">Friends</span>
            </div>
            <div class="col-xs-6 col-sm-3 placeholder">
              <img src="../../Public/images/fc3.jpg" class="img-responsive" alt="Generic placeholder thumbnail">
              <h4>Gangouts</h4>
              <span class="text-muted">Video Calls</span>
            </div>
            <div class="col-xs-6 col-sm-3 placeholder">
              <img src="../../Public/images/fr1.jpg" class="img-responsive" alt="Generic placeholder thumbnail">
              <h4>Gangouts</h4>
              <span class="text-muted">Chats</span>
            </div>
          </div>
			<?php 
$user = new AdminLogin();
$user->displayUsers();
?>
           <form method="POST">
		  <h2 class="sub-header">Registered Users</h2>
          <div class="table-responsive">
            <table class="table table-striped" border="1"  style="margin: 0 auto;">
              <thead>
                <tr>
                  <th>#</th>
                  <th>User Name</th>
                  <th>UserID</th>
                  <th>Email</th>
                  <th>Gender</th>
				  <th>Status</th>	
				  <th>Action</th>		
<?
    require_once 'AdminLogin.php';

    $loginController = new AdminLogin();
    CacheCountry::setCacheBehavior(SessionAdmin::getCacheBehavior());
    CacheCountry::destroyCache();
    $loginController->logout(SessionAdmin::getLoggedUser());
   
?>
Esempio n. 9
0
<?php

require_once '../common/config/config.inc.php';
require_once $arrConfig['sourceRoot'] . 'components/class.validation.inc.php';
require_once SOURCE_ROOT . 'classes/class.adminlogin.php';
$objAdminLogin = new AdminLogin();
if ($_POST['action']) {
    if ($objAdminLogin->doAdminLogin($_POST)) {
        header('location:welcome.php');
    } else {
        header('location: index.php');
    }
} else {
    header('location:index.php');
}
die;
Esempio n. 10
0
<?php

require_once '../common/config/config.inc.php';
require_once $arrConfig['sourceRoot'] . 'classes/class.adminlogin.php';
//**** check user name for login form
if ($_GET['type'] == 'signUp' && $_GET['userEmail'] != '') {
    $objLogin = new AdminLogin();
    $varAdminWhere = " AND AdminUserName='" . $_GET['userEmail'] . "'";
    $varAdminRec = $objLogin->getAdminNumRows($varAdminWhere);
    if ($varAdminRec > 0) {
        $varString = true;
    } else {
        $varString = false;
    }
    echo $varString;
    //echo result return type boolean
}
//**************end here *************************
//**************getting record for product on the bases of category ****************//
if ($_GET['categoryID'] != '') {
    $arrProductCol = array('ProductName', 'pkProductID');
    $varWhereProduct = 'fkCategoryID=\'' . $_GET['categoryID'] . '\' GROUP BY pkProductID';
    $arrProductList = $objGeneral->getRecord(TABLE_PRODUCTS, $arrProductCol, $varWhereProduct);
    if (is_array($arrProductList)) {
        $varString = '<select name="frmProductID" id="frmProductID" style="width:200px;"><option value="">--Select Product--</option>';
        foreach ($arrProductList as $varProductKey => $varProductVal) {
            $varString .= '<option value="' . $varProductVal['pkProductID'] . '">' . $varProductVal['ProductName'] . '</option>';
        }
        echo $varString .= '</select>';
    }
}
Esempio n. 11
0
<?php

require_once '../common/config/config.inc.php';
require_once SOURCE_ROOT . 'components/class.validation.inc.php';
require_once SOURCE_ROOT . 'classes/class.adminlogin.php';
require_once SOURCE_ROOT . 'classes/class.email_templates.php';
require_once SOURCE_ROOT . 'classes/class.extra.php';
$objExtra = new Extra();
$objAdminLogin = new AdminLogin();
$objAdminLogin->isValidAdmin();
if (isset($_POST['submitExtra'])) {
    $objExtra->saveExtras($_POST);
    header('location:settings_frm_uil.php');
    exit;
}
if (isset($_POST['frmSupportEmail'])) {
    $objAdminLogin->changeAdminEmail($_POST);
    header('location:settings_frm_uil.php');
    exit;
}
if (isset($_POST['btnPasswordUpdate'])) {
    $objAdminLogin->changeAdminPassword($_POST);
    header('location:settings_frm_uil.php');
    exit;
}
if (isset($_POST['frmSkipAdminPaging'])) {
    $objAdminLogin->changePaging($_POST);
    header('location:settings_frm_uil.php');
    exit;
}
Esempio n. 12
0
<?php

require_once '../common/config/config.inc.php';
require_once SOURCE_ROOT . 'components/class.validation.inc.php';
/* This is used to forgot password purpose */
require_once SOURCE_ROOT . 'classes/class.adminlogin.php';
require_once SOURCE_ROOT . 'classes/class.email_templates.php';
$objEmailTemplate = new EmailTemplate();
$objAdminLogin = new AdminLogin();
if (isset($_POST['btnMailPassword'])) {
    $objAdminLogin->forgotPasswordMail($_POST);
    header('location:forgot_password.php');
    exit;
}
Esempio n. 13
0
 function contactUs($argArrPOST)
 {
     $objTemplate = new EmailTemplate();
     $objValid = new Validate_fields();
     $objCore = new Core();
     $objGeneral = new General();
     $objValid->check_4html = true;
     $varUserUserName = $argArrPOST['frmEmail'];
     $varUserFirstName = $argArrPOST['frmName'];
     $varUserSubject = $argArrPOST['frmSubject'];
     $varMessage = $argArrPOST['frmMessage'];
     $objValid->add_text_field('Email', strip_tags($argArrPOST['frmEmail']), 'email', 'y', 255);
     $objValid->add_text_field('Name', strip_tags($argArrPOST['frmName']), 'text', 'y', 100);
     $objValid->add_text_field('Subject', strip_tags($argArrPOST['frmSubject']), 'text', 'y', 255);
     $objValid->add_text_field('Message', strip_tags($argArrPOST['frmMessage']), 'text', 'y');
     if ($objValid->validation()) {
         $errorMsgFirst = 'Please enter required fields!';
     } else {
         $errorMsg = $objValid->create_msg();
     }
     if ($errorMsg) {
         $objCore->setErrorMsg($errorMsg);
         return false;
     } else {
         $objAdminLogin = new AdminLogin();
         $varWhere = '';
         $arrAdminResult = $objAdminLogin->getAdminInfo($varWhere);
         $varAdminEmail = $arrAdminResult['0']['AdminEmail'];
         $varPath = "<img src = " . SITE_ROOT_URL . 'common/images/logo.jpg' . ">";
         $varFromUser = SITE_NAME . '<' . $varAdminEmail . '>';
         $varSiteName = SITE_NAME;
         $varWhereTemplate = ' EmailTemplateTitle = binary \'Inquiry email to admin\' AND EmailTemplateStatus = \'Active\' ';
         $arrMailTemplate = $objTemplate->getTemplateInfo($varWhereTemplate);
         $varOutput = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateDescription']));
         $varSubject = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateSubject']));
         $varKeyword = array('{IMAGE_PATH}', '{SITE_NAME}', '{USER_FNAME}', '{USER_USERNAME}', '{USER_SUBJECT}', '{USER_MESSAGE}');
         $varKeywordValues = array($varPath, $varSiteName, $varUserFirstName, $varUserUserName, $varUserSubject, $varMessage);
         $varOutPutValues = str_replace($varKeyword, $varKeywordValues, $varOutput);
         $varSubject = str_replace('{SITE_NAME}', $varSiteName, $varSubject);
         //echo $varOutPutValues;die;
         $objCore->sendMail($varAdminEmail, $varFromUser, $varSubject, $varOutPutValues);
         $objCore->setSuccessMsg(ADMIN_CONTACTUS_MSG);
     }
 }
Esempio n. 14
0
 function sendChangePassMailToUser($argArrPOST)
 {
     $objTemplate = new EmailTemplate();
     $objCore = new Core();
     $objAdminLogin = new AdminLogin();
     $varWhere = '';
     $arrAdminResult = $objAdminLogin->getAdminInfo($varWhere);
     $varAdminEmail = $arrAdminResult['0']['AdminEmail'];
     $varPath = "<img src = " . SITE_ROOT_URL . 'common/images/logo.jpg' . ">";
     $varFirstName = $_SESSION['sessCustomerFirstName'];
     $varUserName = $_SESSION['sessCustomerUserName'];
     $varFrom = SITE_NAME . '<' . $varAdminEmail . '>';
     $varSiteName = SITE_NAME;
     $varWhereTemplate = ' EmailTemplateTitle = binary \'Change User Password\' AND EmailTemplateStatus = \'Active\' ';
     $arrMailTemplate = $objTemplate->getTemplateInfo($varWhereTemplate);
     $varOutput = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateDescription']));
     $varSubject = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateSubject']));
     $varKeyword = array('{IMAGE_PATH}', '{NAME}', '{SITE_NAME}', '{USER_NAME}');
     $varKeywordValues = array($varPath, $varFirstName, $varSiteName, $varUserName);
     $varOutPutValues = str_replace($varKeyword, $varKeywordValues, $varOutput);
     $varSubject = str_replace('{SITE_NAME}', $varSiteName, $varSubject);
     //send email
     $varTo = $varUserName;
     $objCore->sendMail($varTo, $varFrom, $varSubject, $varOutPutValues);
 }
Esempio n. 15
0
<?php

require_once '../common/config/config.inc.php';
require_once SOURCE_ROOT . 'components/class.validation.inc.php';
require_once SOURCE_ROOT . 'classes/class.adminlogin.php';
$objAdminLogin = new AdminLogin();
if (isset($_POST['btnResetPassword'])) {
    if ($objAdminLogin->resetPassword($_POST)) {
        header('location:reset_password.php?op=result');
        exit;
    } else {
        header('location:reset_password.php?mid=' . $_POST['frmMember'] . '&code=' . $_POST['frmCode']);
        exit;
    }
}
Esempio n. 16
0
<?php

if (!empty($_POST['username'])) {
    require_once 'AdminUser.php';
    require_once 'AdminLogin.php';
    echo 'Im here';
    $adminLogin = new AdminLogin(new AdminLoginDao(Connection::connectLogin()));
    if ($adminLogin->login(new AdminUser($_POST['username'], null, $_POST['password']))) {
        header("Location: " . LinkController::getBaseURL() . "/admin");
    } else {
        header("Location: " . LinkController::getBaseURL() . "/admin/login-fail");
    }
} else {
    header("Location: " . LinkController::getBaseURL() . "/admin/login-fail/empty");
}