New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removed en_EN #896
Merged
Merged
removed en_EN #896
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,6 +174,7 @@ public function emon_session_start() | |
$_SESSION['write'] = 1; | ||
//$_SESSION['admin'] = $userData->admin; // Admin mode requires user to login manualy | ||
$_SESSION['lang'] = $userData->language; | ||
$_SESSION['timezone'] = $userData->timezone; | ||
if (isset($userData->startingpage)) $_SESSION['startingpage'] = $userData->startingpage; | ||
// There is a chance that an attacker has stolen the login token, so we store | ||
// the fact that the user was logged in via RememberMe (instead of login form) | ||
|
@@ -193,6 +194,7 @@ public function emon_session_start() | |
if (isset($_SESSION['write'])) $session['write'] = $_SESSION['write']; else $session['write'] = 0; | ||
if (isset($_SESSION['userid'])) $session['userid'] = $_SESSION['userid']; else $session['userid'] = 0; | ||
if (isset($_SESSION['lang'])) $session['lang'] = $_SESSION['lang']; else $session['lang'] = ''; | ||
if (isset($_SESSION['timezone'])) $session['timezone'] = $_SESSION['timezone']; else $session['timezone'] = ''; | ||
if (isset($_SESSION['startingpage'])) $session['startingpage'] = $_SESSION['startingpage']; else $session['startingpage'] = ''; | ||
if (isset($_SESSION['username'])) $session['username'] = $_SESSION['username']; else $session['username'] = 'REMEMBER_ME'; | ||
if (isset($_SESSION['cookielogin'])) $session['cookielogin'] = $_SESSION['cookielogin']; else $session['cookielogin'] = 0; | ||
|
@@ -340,13 +342,13 @@ public function login($username, $password, $remembermecheck) | |
|
||
// 28/04/17: Changed explicitly stated fields to load all with * in order to access startingpage | ||
// without cuasing an error if it has not yet been created in the database. | ||
if (!$stmt = $this->mysqli->prepare("SELECT id,password,salt,apikey_write,admin,language,startingpage,email_verified FROM users WHERE username=?")) { | ||
if (!$stmt = $this->mysqli->prepare("SELECT id,password,salt,apikey_write,admin,language,startingpage,email_verified,timezone FROM users WHERE username=?")) { | ||
return array('success'=>false, 'message'=>_("Database error, you may need to run database update")); | ||
} | ||
$stmt->bind_param("s",$username); | ||
$stmt->execute(); | ||
|
||
$stmt->bind_result($userData_id,$userData_password,$userData_salt,$userData_apikey_write,$userData_admin,$userData_language,$userData_startingpage,$email_verified); | ||
$stmt->bind_result($userData_id,$userData_password,$userData_salt,$userData_apikey_write,$userData_admin,$userData_language,$userData_startingpage,$email_verified,$userData_timezone); | ||
$result = $stmt->fetch(); | ||
$stmt->close(); | ||
|
||
|
@@ -372,6 +374,7 @@ public function login($username, $password, $remembermecheck) | |
$_SESSION['write'] = 1; | ||
$_SESSION['admin'] = $userData_admin; | ||
$_SESSION['lang'] = $userData_language; | ||
$_SESSION['timezone'] = $userData_timezone; | ||
$_SESSION['startingpage'] = $userData_startingpage; | ||
|
||
if ($this->enable_rememberme) { | ||
|
@@ -711,8 +714,12 @@ public function get($userid) | |
|
||
public function set($userid,$data) | ||
{ | ||
global $default_language; | ||
$default_locale = !empty($default_language) ? $default_language : 'en_GB'; | ||
$default_timezone = 'Europe/London'; | ||
// Validation | ||
$userid = (int) $userid; | ||
if(!$data || $userid < 1) return array('success'=>false, 'message'=>_("Error updating user info")); | ||
|
||
$gravatar = preg_replace('/[^\w\s-.@]/','',$data->gravatar); | ||
$name = preg_replace('/[^\p{N}\p{L}_\s-.]/u','',$data->name); | ||
|
@@ -721,10 +728,10 @@ public function set($userid,$data) | |
$bio = preg_replace('/[^\p{N}\p{L}_\s-.]/u','',$data->bio); | ||
$language = preg_replace('/[^\w\s-.]/','',$data->language); | ||
$tags = isset($data->tags) == false ? '' : preg_replace('/[^{}",:\w\s-.]/','', $data->tags); | ||
|
||
$startingpage = preg_replace('/[^\p{N}\p{L}_\s-?#=\/]/u','',$data->startingpage); | ||
|
||
$_SESSION['lang'] = $language; | ||
$_SESSION['lang'] = !empty($language) ? $language : $default_locale; | ||
$_SESSION['timezone'] = !empty($timezone) ? $timezone : $default_timezone; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure if these session variables are used by anything ... any ideas where this might be useful? |
||
|
||
$stmt = $this->mysqli->prepare("UPDATE users SET gravatar = ?, name = ?, location = ?, timezone = ?, language = ?, bio = ?, startingpage = ?, tags = ? WHERE id = ?"); | ||
$stmt->bind_param("ssssssssi", $gravatar, $name, $location, $timezone, $language, $bio, $startingpage, $tags, $userid); | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be a good idea to put $default_timezone in settings.php too?