From 31e534857a766d270f8e880fdf6d7fd5250286fd Mon Sep 17 00:00:00 2001 From: Quitta Date: Fri, 28 Jun 2013 18:10:02 +0200 Subject: [PATCH] add language flags + js for activating them --- .../ryzom_ams/ams_lib/autoload/users.php | 40 ++++++++++++++---- .../ryzom_ams/ams_lib/translations/en.ini | 1 + .../ryzom_ams/ams_lib/translations/fr.ini | 1 + .../server/ryzom_ams/www/html/css/custom.css | 7 +++ .../server/ryzom_ams/www/html/img/en.png | Bin 0 -> 725 bytes .../server/ryzom_ams/www/html/img/fr.png | Bin 0 -> 675 bytes .../ryzom_ams/www/html/templates/layout.tpl | 8 +++- .../ryzom_ams/www/html/templates/userlist.tpl | 2 +- 8 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 code/ryzom/tools/server/ryzom_ams/www/html/img/en.png create mode 100644 code/ryzom/tools/server/ryzom_ams/www/html/img/fr.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php index bdc6f32a7..c99e8567d 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php @@ -69,7 +69,7 @@ class Users{ * @takes $username * @return string Info: Returns a string based on if the username is valid, if valid then "success" is returned */ - public function checkUser( $username ) + private function checkUser( $username ) { if ( isset( $username ) ){ if ( strlen( $username ) > 12 ){ @@ -89,6 +89,31 @@ class Users{ return "fail"; } + /** + * Function checkUserAlreadyExists + * + * @takes $username + * @return string Info: Returns true or false if the user is in the lib+shard db. + * + private function checkUserAlreadyExists( $username ) + { + global $cfg; + $dbl = new DBLayer($cfg['db']['lib']); + $dbs = new DBLayer($cfg['db']['shard']); + try{ + if ($this->dbl->execute("SELECT * FROM user WHERE Login = :name",array('name' => $username))->rowCount()){ + return true; + } + if ($this->dbs->execute("SELECT * FROM user WHERE Login = :name",array('name' => $username))->rowCount()){ + return true; + } + return false; + }catch (PDOException $e) { + //in case one of them is offline let it be hanled lateron with the + return true; + } + }*/ + /** * Function checkPassword @@ -96,7 +121,7 @@ class Users{ * @takes $pass * @return string Info: Returns a string based on if the password is valid, if valid then "success" is returned */ - public function checkPassword( $pass ) + private function checkPassword( $pass ) { if ( isset( $pass ) ){ if ( strlen( $pass ) > 20 ){ @@ -119,7 +144,7 @@ class Users{ * @takes $pass * @return string Info: Verify's $_POST["Password"] is the same as $_POST["ConfirmPass"] */ - public function confirmPassword($pass_result) + private function confirmPassword($pass_result) { if ( ( $_POST["Password"] ) != ( $_POST["ConfirmPass"] ) ){ return "Passwords do not match."; @@ -140,7 +165,7 @@ class Users{ * @takes $email * @return */ - public function checkEmail( $email ) + private function checkEmail( $email ) { if ( isset( $email ) ){ if ( !Users::validEmail( $email ) ){ @@ -164,7 +189,7 @@ class Users{ * @takes $email * @return true or false depending on if its a valid email format. */ - public function validEmail( $email ){ + private function validEmail( $email ){ $isValid = true; $atIndex = strrpos( $email, "@" ); if ( is_bool( $atIndex ) && !$atIndex ){ @@ -256,7 +281,7 @@ class Users{ * @takes $array with name,pass and mail * @return ok if it's get correctly added to the shard, else return lib offline and put in libDB, if libDB is also offline return liboffline. */ - function createUser($values){ + public function createUser($values){ try { //make connection with and put into shard db global $cfg; @@ -277,8 +302,7 @@ class Users{ } } - } - + } } diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini index eafb7df63..c60e5a621 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini @@ -4,6 +4,7 @@ [home] [userlist] +userlist_info = "welcome to the userlist" [login] login_info = "Please login with your Username and Password." diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini index 1e186ec0f..432845f91 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini @@ -4,6 +4,7 @@ [home] [userlist] +userlist_info = "bienvenue sur le userlist page!" [login] login_info = "S'il vous plait vous connecter avec votre nom d'utilisateur et mot de passe." diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/css/custom.css b/code/ryzom/tools/server/ryzom_ams/www/html/css/custom.css index d4688a89d..28e29141f 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/css/custom.css +++ b/code/ryzom/tools/server/ryzom_ams/www/html/css/custom.css @@ -19,3 +19,10 @@ .navbar { border-bottom: 0px; } + +.flags { + display: block; + position:relative; + left:290px; + top:28px; +} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/img/en.png b/code/ryzom/tools/server/ryzom_ams/www/html/img/en.png new file mode 100644 index 0000000000000000000000000000000000000000..6505dc41bf7b149e23135b89b37db9a6855e9163 GIT binary patch literal 725 zcmV;`0xJE9P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv0006+Nkl5XaAB54}i*g%3Ri z#in6wrGhMGhJp#znkkE}X@-ba=0jv{?xq!f;a4Au8k%94r5UM#nX)Nak)p0qDj^YU z5Oh`+EYoH;$8{e$lk!7q}Mj zWT;A1Q}*gv-4nV-AoJ~D6tC)^vo)vzqqz&QDF<=j#1rm!`KJEIYTjRAJJ$3j4b`-hxrIO`E7_x%|p~3${;$sm4MxiY}{GPh8`8G5hlTTO_q3;r}vuS^V*ThRO#h^RC|200000NkvXX Hu0mjfj3!K^ literal 0 HcmV?d00001 diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/img/fr.png b/code/ryzom/tools/server/ryzom_ams/www/html/img/fr.png new file mode 100644 index 0000000000000000000000000000000000000000..60ed561d4f39c3520239d77c1dd948e22977796e GIT binary patch literal 675 zcmV;U0$lxxP)pF8gxZibW?9;ba!ELWdKlNX>N2bPDNB8 zb~7$DE-^4L^m3s900JLLL_t(IPsNixPg7wShR@~?aPS8>JG$!N;74LG8XFMdmp{4D1dEOUGNE|yj z+~ajU_w&4Y6+mexZNXx&a`S0~?dg9KB9TZCi^YgWqlCj@0)YU*U=U-cLV1TmK~cz= z$(WIX&yk{xFQoG^SfJT#(r7ef>h(IcT8(P8N^|THjnNS{9^R$)V3_2VAY5eri^|+` zj(5Hc#bOa%*C`YVflw@`@31cH$+?tMkDyX>k^(Z;kQd^%H^_z zw@Wgaj0yK(^mS9|wO|Yn@Jk48JPxrG(3tsT!i#BMEhH(GN}DZY0}WMG5dx#nN~Py4 zrS2}uL%l?Wz&5gq_gmhCe=}*qFFk7*h9O%BiAZaevQ5C9=;w}6ymf_$5LoZ8@cygH zBW?Jyfqx2I4@kWt!HdWM165Y{n`aIo5h4rp_=O~3&H-&9`>Ghv8QXA-5syl zb&5MMGwXCRH8q99;b44xT<$Dti^&3(f_6TV{0skG@CO0`4|2m%YCr%0002ov JPDHLkV1mp}FXI3J literal 0 HcmV?d00001 diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout.tpl index 075190b64..bfa20ee41 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout.tpl @@ -101,10 +101,14 @@
  • Logout
  • +
    +
    + + +
    +
    {/if} - - diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/userlist.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/userlist.tpl index 53d46ddd6..59cb17574 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/userlist.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/userlist.tpl @@ -3,7 +3,7 @@
    -

    User List

    +

    {$userlist_info}