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 ffac7bc8d..3d500af69 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 @@ -27,13 +27,13 @@ class Users{ 'status' => 1, 'access' => REQUEST_TIME ); - user_save( NULL, $edit ); + //user_save( NULL, $edit ); header( 'Location: email_sent.php' ); exit; }else{ $pageElements = array( - 'GAME_NAME' => variable_get( 'ryzommanage_game-name', '' ), - 'WELCOME_MESSAGE' => variable_get( 'ryzommanage_register-welcome', '' ), + //'GAME_NAME' => variable_get( 'ryzommanage_game-name', '' ), + //'WELCOME_MESSAGE' => variable_get( 'ryzommanage_register-welcome', '' ), 'USERNAME' => $user, 'PASSWORD' => $pass, 'CPASSWORD' => $cpass, @@ -84,10 +84,10 @@ class Users{ return "Username must be 5 or more characters."; }elseif ( !preg_match( '/^[a-z0-9\.]*$/', $username ) ){ return "Username can only contain numbers and letters."; - }elseif ( sql :: db_query( "SELECT COUNT(*) FROM {users} WHERE name = :name", array( + /*}elseif ( sql :: db_query( "SELECT COUNT(*) FROM {users} WHERE name = :name", array( ':name' => $username ) ) -> fetchField() ){ - return "Username " . $username . " is in use."; + return "Username " . $username . " is in use.";*/ }else{ return "success"; } @@ -139,12 +139,12 @@ class Users{ public function checkEmail( $email ) { if ( isset( $email ) ){ - if ( !validEmail( $email ) ){ + if ( !Users::validEmail( $email ) ){ return "Email address is not valid."; - }elseif ( db_query( "SELECT COUNT(*) FROM {users} WHERE mail = :mail", array( + /*}elseif ( db_query( "SELECT COUNT(*) FROM {users} WHERE mail = :mail", array( ':mail' => $email ) ) -> fetchField() ){ - return "Email is in use."; + return "Email is in use.";*/ }else{ return "success"; } @@ -153,49 +153,50 @@ class Users{ } return "fail"; } - public function validEmail( $email ) - { - $isValid = true; - $atIndex = strrpos( $email, "@" ); - if ( is_bool( $atIndex ) && !$atIndex ){ - $isValid = false; - }else{ - $domain = substr( $email, $atIndex + 1 ); - $local = substr( $email, 0, $atIndex ); - $localLen = strlen( $local ); - $domainLen = strlen( $domain ); - if ( $localLen < 1 || $localLen > 64 ){ - // local part length exceeded - $isValid = false; - }else if ( $domainLen < 1 || $domainLen > 255 ){ - // domain part length exceeded - $isValid = false; - }else if ( $local[0] == '.' || $local[$localLen - 1] == '.' ){ - // local part starts or ends with '.' - $isValid = false; - }else if ( preg_match( '/\\.\\./', $local ) ){ - // local part has two consecutive dots - $isValid = false; - }else if ( !preg_match( '/^[A-Za-z0-9\\-\\.]+$/', $domain ) ){ - // character not valid in domain part - $isValid = false; - }else if ( preg_match( '/\\.\\./', $domain ) ){ - // domain part has two consecutive dots - $isValid = false; - }else if ( !preg_match( '/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace( "\\\\", "", $local ) ) ){ - // character not valid in local part unless - // local part is quoted - if ( !preg_match( '/^"(\\\\"|[^"])+"$/', str_replace( "\\\\", "", $local ) ) ){ - $isValid = false; + + public function validEmail( $email ){ + $isValid = true; + $atIndex = strrpos( $email, "@" ); + if ( is_bool( $atIndex ) && !$atIndex ){ + $isValid = false; + }else{ + $domain = substr( $email, $atIndex + 1 ); + $local = substr( $email, 0, $atIndex ); + $localLen = strlen( $local ); + $domainLen = strlen( $domain ); + if ( $localLen < 1 || $localLen > 64 ){ + // local part length exceeded + $isValid = false; + }else if ( $domainLen < 1 || $domainLen > 255 ){ + // domain part length exceeded + $isValid = false; + }else if ( $local[0] == '.' || $local[$localLen - 1] == '.' ){ + // local part starts or ends with '.' + $isValid = false; + }else if ( preg_match( '/\\.\\./', $local ) ){ + // local part has two consecutive dots + $isValid = false; + }else if ( !preg_match( '/^[A-Za-z0-9\\-\\.]+$/', $domain ) ){ + // character not valid in domain part + $isValid = false; + }else if ( preg_match( '/\\.\\./', $domain ) ){ + // domain part has two consecutive dots + $isValid = false; + }else if ( !preg_match( '/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace( "\\\\", "", $local ) ) ){ + // character not valid in local part unless + // local part is quoted + if ( !preg_match( '/^"(\\\\"|[^"])+"$/', str_replace( "\\\\", "", $local ) ) ){ + $isValid = false; } - } - if ( $isValid && !( checkdnsrr( $domain, "MX" ) || checkdnsrr( $domain, "A" ) ) ){ - // domain not found in DNS - $isValid = false; - } - } - return $isValid; - } + } + if ( $isValid && !( checkdnsrr( $domain, "MX" ) || checkdnsrr( $domain, "A" ) ) ){ + // domain not found in DNS + $isValid = false; + } + } + return $isValid; + } + public function generateSALT( $length = 2 ) { // start with a blank salt 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 e25bfd88b..af9f29d05 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 @@ -7,20 +7,27 @@ [register] title = "RYZOM CORE INGAME REGISTRATION" -welcome_message = "Welcome! Please fill in the following fields to get your new Ryzom Core account:" +welcome_message = "Welcome! Please fill in the following fields to get your new Ryzom Core account" -username_tag = "Desired Username:" +username_tag = "Desired Username" username_tooltip = "5-12 lower-case characters and numbers. The login (username) you create here will be your login name. The name of your game characters will be chosen later on." +username_default = "Username" -password_tag = "Desired Password:" +password_tag = "Desired Password" +password_tooltip = "Pick a hard to guess password (it must be 5-20 characters)." password_message = "Password must be 5-20 characters." +password_default = "Password" -cpassword_tag = "Confirm Password:" +cpassword_tag = "Confirm Password" +cpassword_tooltip = "Retype your Password" cpassword_message = "Retype your Password" +cpassword_default = "Re-enter Password" -email_tag = "Email Address (to which a confirmation email will be sent):" +email_tag = "Email Address" +email_tooltip = "Email Address to which a confirmation email will be sent." email_message = "Please verify that the e-mail address you enter here is valid and will remain valid in the future. It will only be used to manage your Ryzom Core account." +email_default = "Email" -tac_tag = "YES, I agree to the terms of service." +tac_tag = "YES, I agree to the terms of service." tac_message = "You must accept the Terms of Service." diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/add_user.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/add_user.php index 41284659e..0fedc2aba 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/add_user.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/add_user.php @@ -1,8 +1,9 @@ 1, 'no_visible_elements' => 'FALSE' ); +//Page Handling +if($page == 'login' || $page == 'register'){ + $no_visible_elements = 'TRUE'; +} + +if ( isset($functionReturn) ){ + $return = array_merge(array( 'permission' => 1, 'no_visible_elements' => $no_visible_elements ),$functionReturn); +}else{ + $return = array( 'permission' => 1, 'no_visible_elements' => $no_visible_elements ); +} +//print_r($return); helpers :: loadTemplate( $page , $return ); diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/js/help.js b/code/ryzom/tools/server/ryzom_ams/www/html/js/help.js index 519454ef6..60a9980aa 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/js/help.js +++ b/code/ryzom/tools/server/ryzom_ams/www/html/js/help.js @@ -1,13 +1,13 @@ function show_help(help_tip) { - if(help_tip =='test') + if(help_tip =='intro') { var tour = new Tour(); tour.addStep({ element: ".brand:first", /* html element next to which the step popover should be shown */ placement: "bottom", - title: "Custom Tour", /* title of the popover */ - content: "You can create tour like this. Click Next." /* content of the popover */ + title: "Account Management System", /* title of the popover */ + content: "Welcome to the Ryzom Core Account Management System! Let's explore it together... Click next!" /* content of the popover */ }); tour.addStep({ element: ".theme-container", diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/home.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/home.tpl index f517f60c4..fb14ba5ba 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/home.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/home.tpl @@ -36,16 +36,14 @@

Introduction

- +
-

Charisma free, premium quality, responsive, multiple skin admin template.

-

Its a live demo of the template. I have created Charisma to ease the repeat work I have to do on my projects. Now I re-use Charisma as a base for my admin panel work and I am sharing it with you :)

-

All pages in the menu are functional, take a look at all, please share this with your followers.

+

Welcome to the Ryzom Core - Account Management System

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 90902b2f5..5cbc80a2d 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 @@ -88,7 +88,6 @@ -
@@ -134,6 +133,8 @@ {/if} {block name=content}{/block} + + {if ! isset($no_visible_elements) or $no_visible_elements eq "FALSE"}
{/if} diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/register.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/register.tpl index 8649a7dc6..2ebdd67a9 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/register.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/register.tpl @@ -12,119 +12,118 @@
{$welcome_message}
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$username_tag} - - {if isset($Username)}{$Username}{/if}
{$password_tag} - - {if isset($PASSWORD_ERROR) && $PASSWORD_ERROR eq "TRUE"}{$Password}{/if}
{$cpassword_tag} - {if isset($CPASSWORD_ERROR) && $CPASSWORD_ERROR eq "TRUE"}{$ConfirmPass}{/if}
{$email_tag} - - {if isset($EMAIL_ERROR) && $EMAIL_ERROR eq "TRUE"}{$Email}{/if}
{$tac_tag}
{$tac_message}
- -
- -
- -
- -
- -
-
- {$username_tooltip} -
-
- -
-
- {$password_message} +
+ {$title} + +
+ +
+
+ + +
+
-
-
-
- {$cpassword_message} -
-
-
-
- {$email_message} +
+ +
+
+ + +
+
-
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+
+
+ {$tac_tag} + +
+
+
+ + {if isset($USERNAME_ERROR) and $USERNAME_ERROR eq "TRUE"} +
+ + Username Error {$USERNAME} +
+ {/if} + + {if isset($PASSWORD_ERROR) and $PASSWORD_ERROR eq "TRUE"} +
+ + Password Error {$PASSWORD} +
+ {/if} + + {if isset($CPASSWORD_ERROR) and $CPASSWORD_ERROR eq "TRUE"} +
+ + Confirmation Password Error {$CPASSWORD} +
+ {/if} + + {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE"} +
+ + Email Error {$EMAIL} +
+ {/if} + + {if isset($TAC_ERROR) and $TAC_ERROR eq "TRUE"} +
+ + Terms of Service Error {$tac_message} +
+ {/if} + + + +
+ +
+ + +
+ + + + +
+ +
{/block} + +