Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.75 KB | None | 0 0
  1. <?php
  2. /*
  3. UserSpice 4
  4. An Open Source PHP User Management System
  5. by the UserSpice Team at http://UserSpice.com
  6.  
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. // error_reporting(E_ALL);
  21. // ini_set('display_errors', 1);
  22. ini_set("allow_url_fopen", 1);
  23. ?>
  24. <?php require_once '../users/init.php'; ?>
  25. <?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
  26. <?php require_once $abs_us_root.$us_url_root.'users/includes/navigation.php'; ?>
  27. <?php
  28. $settingsQ = $db->query("SELECT * FROM settings");
  29. $settings = $settingsQ->first();
  30. $error_message = '';
  31. if (@$_REQUEST['err']) $error_message = $_REQUEST['err']; // allow redirects to display a message
  32. $reCaptchaValid=FALSE;
  33.  
  34. if (!empty($_GET)) {
  35.             $user = new User();
  36.             $login = $user->loginEmail(Input::get('username'), trim(Input::get('password')), $remember);
  37.             if ($login) {
  38.                 if(file_exists($abs_us_root.$us_url_root.'usersc/scripts/custom_login_script.php')){
  39.                     # Note that the custom_login_script often contains a Redirect::to() call
  40.                    require_once $abs_us_root.$us_url_root.'usersc/scripts/custom_login_script.php';
  41.                 }else{
  42.                     //var_dump($_POST);
  43.                     if (($dest = sanitizedAfterLoginGoto()) ||
  44.                             ($dest = Config::get('homepage')) ||
  45.                             ($dest = '../users/account.php')) {
  46.                         Redirect::to($dest);
  47.                     }
  48.                 }
  49.             } else {
  50.                 $error_message .= 'Log in failed. Please check your username and password and try again.';
  51.             }
  52.         } else{
  53.             $error_message .= '<ul>';
  54.             foreach ($validation->errors() as $error) {
  55.                 $error_message .= '<li>' . $error . '</li>';
  56.             }
  57.             $error_message .= '</ul>';
  58.         }
  59.  
  60. ?>
  61.  
  62. <div id="page-wrapper">
  63. <div class="container">
  64. <div class="row">
  65.     <div class="col-xs-12">
  66.     <div class="bg-danger"><?=$error_message;?></div>
  67.     <form name="login" class="form-signin" action="login.php" method="post">
  68.     <h2 class="form-signin-heading"></i> <?=lang("SIGNIN_TITLE","");?></h2>
  69.     <input type="hidden" name="afterLoginGoto" value="<?= @$_REQUEST['afterLoginGoto'] ?>" />
  70.  
  71.     <div class="form-group">
  72.         <label for="username" >Username OR Email</label>
  73.         <input  class="form-control" type="text" name="username" id="username" placeholder="Username/Email" required autofocus>
  74.     </div>
  75.  
  76.     <div class="form-group">
  77.         <label for="password">Password</label>
  78.         <input type="password" class="form-control"  name="password" id="password"  placeholder="Password" required autocomplete="off">
  79.     </div>
  80.  
  81.     <?php
  82.     if($settings->recaptcha == 1){
  83.     ?>
  84.     <div class="form-group">
  85.     <label>Please check the box below to continue</label>
  86.     <div class="g-recaptcha" data-sitekey="<?=$publickey; ?>"></div>
  87.     </div>
  88.     <?php } ?>
  89.  
  90.     <div class="form-group">
  91.     <label for="remember">
  92.     <input type="checkbox" name="remember" id="remember" > Remember Me</label>
  93.     </div>
  94.  
  95.     <input type="hidden" name="csrf" value="<?=Token::generate(); ?>">
  96.     <button class="submit  btn  btn-primary" type="submit"><i class="fa fa-sign-in"></i> <?=lang("SIGNIN_BUTTONTEXT","");?></button>
  97.  
  98.     </form>
  99.     </div>
  100. </div>
  101. <div class="row">
  102.     <div class="col-xs-6"><br>
  103.         <a class="pull-left" href='forgot_password.php'><i class="fa fa-wrench"></i> Forgot Password</a><br><br>
  104.     </div>
  105.     <div class="col-xs-6"><br>
  106.         <a class="pull-right" href='join.php'><i class="fa fa-plus-square"></i> <?=lang("SIGNUP_TEXT","");?></a><br><br>
  107.     </div>
  108. </div>
  109. </div>
  110. </div>
  111.  
  112.     <!-- footers -->
  113. <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
  114.  
  115.     <!-- Place any per-page javascript here -->
  116.  
  117. <?php   if($settings->recaptcha == 1){ ?>
  118. <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  119. <?php } ?>
  120. <?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement