#335 fixed default langauge enUS for projects which do not serve this language
This commit is contained in:
parent
f0865e9672
commit
5fa46aef55
@ -57,10 +57,10 @@ class api_login {
|
||||
* @param string $username Username
|
||||
* @param sha1 $password_sha1 User Password SHA1 String
|
||||
* @param email $email Email of the new User
|
||||
* @param lang $locale Locale which the User wants to register
|
||||
* @param lang $locale Locale which the User wants to register or null for default language
|
||||
* @return JSON Returns JSON result with success/failure status
|
||||
*/
|
||||
public static function call_account_action_create($username, $password_sha1, $email, $locale){
|
||||
public static function call_account_action_create($username, $password_sha1, $email, $locale = null){
|
||||
return \SYSTEM\SECURITY\security::create($username, $password_sha1, $email, $locale,true);}
|
||||
|
||||
/**
|
||||
|
||||
@ -364,8 +364,7 @@ SYSTEM.prototype.account_create = function(username,password,email,success){
|
||||
action: 'create',
|
||||
username: username,
|
||||
password_sha1: $.sha1(password),
|
||||
email: email,
|
||||
locale: 'enUS'
|
||||
email: email
|
||||
},
|
||||
success: success,
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown){
|
||||
|
||||
@ -25,10 +25,11 @@ class security {
|
||||
* @param bool $json_result Return data as JSON or Array
|
||||
* @return mixed Returns json with status true or Error or Array with userinfo.
|
||||
*/
|
||||
public static function create($username, $password_sha1, $email, $locale = 'enUS',$json_result = false){
|
||||
public static function create($username, $password_sha1, $email, $locale = null,$json_result = false){
|
||||
self::startSession();
|
||||
if(!self::available($username)){
|
||||
throw new \SYSTEM\LOG\ERROR("Username unavailable");}
|
||||
$locale = $locale ? $locale : \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG);
|
||||
$result = \SYSTEM\SQL\SYS_SECURITY_CREATE::QI(array( $username , $password_sha1, $email, $locale));
|
||||
$row = true;
|
||||
if(!$result || !($row = self::login($username, $password_sha1, $locale))){
|
||||
|
||||
@ -22,7 +22,7 @@ REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `na
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (24, 0, 2, 11, 'create', 'username', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (25, 0, 2, 11, 'create', 'password_sha1', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (26, 0, 2, 11, 'create', 'email', 'EMAIL');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 0, 2, 11, 'create', 'locale', 'LANG');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 0, 3, 11, 'create', 'locale', 'LANG');
|
||||
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (30, 0, 2, 10, 'files', 'cat', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 0, 3, 10, 'files', 'id', 'STRING');
|
||||
|
||||
@ -27,7 +27,7 @@ REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `na
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (24, 42, 2, 11, 'create', 'username', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (25, 42, 2, 11, 'create', 'password_sha1', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (26, 42, 2, 11, 'create', 'email', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 42, 3, 11, 'create', 'locale', 'LANG');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 42, 3, 10, 'files', 'id', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 42, 2, 10, 'text', 'request', 'STRING');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user