Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent 3995283642
commit 68b6e85cda
  1. 44
      custompages/first_login.php
  2. 13
      custompages/loggedout.php

@ -16,29 +16,29 @@ require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
if (! isset($_SESSION['conditional_login']['uid'])) if (! isset($_SESSION['conditional_login']['uid']))
die("Not Authorised"); die("Not Authorised");
if (isset($_POST['password'])){ if (isset($_POST['password'])) {
$u = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']); $u = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']);
if ($_POST['password'] != $_POST['password2']) { if ($_POST['password'] != $_POST['password2']) {
header('Location: '. api_get_self().'?invalid=2'); header('Location: '. api_get_self().'?invalid=2');
exit(); exit();
} }
if (empty($_POST['password'])){ //|| !api_check_password($password)) { //Pass must be at least 5 char long with 2 digits and 3 letters if (empty($_POST['password'])){ //|| !api_check_password($password)) { //Pass must be at least 5 char long with 2 digits and 3 letters
header('Location: '. api_get_self().'?invalid=1'); header('Location: '. api_get_self().'?invalid=1');
exit(); exit();
} }
$password = $_POST['password']; $password = $_POST['password'];
$updated = UserManager::update_user($u['user_id'], $u['firstname'], $u['lastname'], $u['username'], $password, $u['auth_source'], $u['email'], $u['status'], $u['official_code'], $u['phone'], $u['picture_uri'], $u['expiration_date'], $u['active'], $u['creator_id'], $u['hr_dept_id'], null, $u['language'],''); $updated = UserManager::update_user($u['user_id'], $u['firstname'], $u['lastname'], $u['username'], $password, $u['auth_source'], $u['email'], $u['status'], $u['official_code'], $u['phone'], $u['picture_uri'], $u['expiration_date'], $u['active'], $u['creator_id'], $u['hr_dept_id'], null, $u['language'],'');
if ($updated) { if ($updated) {
UserManager::update_extra_field_value($u['user_id'], 'already_logged_in', 'true'); UserManager::update_extra_field_value($u['user_id'], 'already_logged_in', 'true');
ConditionalLogin::login(); ConditionalLogin::login();
} }
} }
if ($_GET['invalid'] == 1) { if ($_GET['invalid'] == 1) {
$error_message = get_lang('CurrentPasswordEmptyOrIncorrect'); $error_message = get_lang('CurrentPasswordEmptyOrIncorrect');
} }
if ($_GET['invalid'] == 2) { if ($_GET['invalid'] == 2) {
$error_message = get_lang('PassTwo'); $error_message = get_lang('PassTwo');
} }
/** /**
* HTML output * HTML output
@ -59,11 +59,11 @@ if ($_GET['invalid'] == 2) {
<script type="text/javascript" src="/main/inc/lib/javascript/jquery.min.js"></script> <script type="text/javascript" src="/main/inc/lib/javascript/jquery.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
if (top.location != location) if (top.location != location)
top.location.href = document.location.href ; top.location.href = document.location.href ;
// Handler pour la touche retour // Handler pour la touche retour
$('input').keyup(function(e) { $('input').keyup(function(e) {
if (e.keyCode == 13) { if (e.keyCode == 13) {
$('#changepassword-form').submit(); $('#changepassword-form').submit();
} }
@ -80,12 +80,12 @@ if ($_GET['invalid'] == 2) {
<img src="/custompages/images/header.png" alt="Logo" /> <img src="/custompages/images/header.png" alt="Logo" />
</div> <!-- #header --> </div> <!-- #header -->
<h2> <?php echo custompages_get_lang('FirstLogin');?> </h2> <h2> <?php echo custompages_get_lang('FirstLogin');?> </h2>
<div id="changepassword-form-box" class="form-box"> <div id="changepassword-form-box" class="form-box">
<div class="info"> <?php echo custompages_get_lang('FirstLoginChangePassword');?> </div> <div class="info"> <?php echo custompages_get_lang('FirstLoginChangePassword');?> </div>
<?php if (isset($error_message)) { <?php if (isset($error_message)) {
echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>'; echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>';
}?> }?>
<form id="changepassword-form" class="form" method="post"> <form id="changepassword-form" class="form" method="post">
<div> <div>
<label for="password">*<?php echo custompages_get_lang('langPass');?></label> <label for="password">*<?php echo custompages_get_lang('langPass');?></label>

@ -8,12 +8,11 @@
* Init * Init
*/ */
$called_direcly = !function_exists('api_get_path'); $called_direcly = !function_exists('api_get_path');
if ($called_direcly) if ($called_direcly) {
{
return ''; return '';
} }
require_once('language.php'); require_once 'language.php';
$www = api_get_path('WEB_PATH'); $www = api_get_path('WEB_PATH');
/** /**
@ -31,12 +30,10 @@ $www = api_get_path('WEB_PATH');
<!--[if IE 6]> <!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" /> <link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
<![endif]--> <![endif]-->
<script type="text/javascript" src="<?php echo $www ?>main/inc/lib/javascript/jquery.min.js"></script> <script type="text/javascript" src="<?php echo $www ?>main/inc/lib/javascript/jquery.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
if (top.location != location) if (top.location != location)
top.location.href = document.location.href ; top.location.href = document.location.href ;
}); });
</script> </script>
@ -58,7 +55,7 @@ $www = api_get_path('WEB_PATH');
<a href="<?php echo $www . 'user_portal.php'; ?>">Go to your portal</a> <a href="<?php echo $www . 'user_portal.php'; ?>">Go to your portal</a>
<div id="footer"> <div id="footer">
<img src="<?php echo $www ?>/custompages/images/footer.png" alt="footer"/> <img src="<?php echo $www ?>/custompages/images/footer.png" alt="footer"/>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

Loading…
Cancel
Save