diff --git a/.hgignore b/.hgignore index 17929f871..9fb922bbb 100644 --- a/.hgignore +++ b/.hgignore @@ -146,6 +146,7 @@ external_stlport .svn thumbs.db Thumbs.db +*.tpl.php # build code/nel/build/* diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php index ec3e55284..182f014cf 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php @@ -1,7 +1,7 @@ $value ){ $smarty -> assign( $key, $value ); } - if($vars['permission'] == 1){ - $inherited = "layout_admin.tpl"; - }else{ - $inherited = "layout_user.tpl"; - } - //extends:' . $inherited .'|register.tpl - $smarty -> display( 'register.tpl' ); + if( $vars['permission'] == 1 ){ + $inherited = "layout_admin.tpl"; + }else{ + $inherited = "layout_user.tpl"; + } + // extends:' . $inherited .'|register.tpl + $smarty -> display( $template . '.tpl' ); } - public function create_folders(){ + static public function create_folders(){ global $AMS_LIB; global $SITEBASE; - $arr = array( $AMS_LIB . '/ingame_templates/', - $AMS_LIB . '/configs', - $AMS_LIB . '/cache', - $SITEBASE . '/cache/', - $SITEBASE . '/templates/', - $SITEBASE . '/templates_c/', - $SITEBASE . '/configs' - ); - foreach ( $arr as & $value ){ + $arr = array( $AMS_LIB . '/ingame_templates/', + $AMS_LIB . '/configs', + $AMS_LIB . '/cache', + $SITEBASE . '/cache/', + $SITEBASE . '/templates/', + $SITEBASE . '/templates_c/', + $SITEBASE . '/configs' + ); + foreach ( $arr as & $value ){ if ( !file_exists( $value ) ){ mkdir( $value ); } - } + } } - public function check_if_game_client() + static public function check_if_game_client() { // if HTTP_USER_AGENT is not set then its ryzom core if ( !isset( $_SERVER['HTTP_USER_AGENT'] ) ){ diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sql.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sql.php index f64122f7c..609ed8740 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sql.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sql.php @@ -1,11 +1,10 @@ $_POST["Username"], 'pass' => $_POST["Password"], 'mail' => $_POST["Email"], @@ -31,7 +31,7 @@ class Users{ header( 'Location: email_sent.php' ); exit; }else{ - $pageElements = array( + $pageElements = array( 'GAME_NAME' => variable_get( 'ryzommanage_game-name', '' ), 'WELCOME_MESSAGE' => variable_get( 'ryzommanage_register-welcome', '' ), 'USERNAME' => $user, @@ -44,7 +44,7 @@ class Users{ }else{ $pageElements['USERNAME_ERROR'] = 'FALSE'; } - + if ( $pass != "success" ){ $pageElements['PASSWORD_ERROR'] = 'TRUE'; }else{ @@ -68,10 +68,10 @@ class Users{ return $pageElements; } } - + /** * Function checkUser - * + * * @takes $username * @return string Info: Returns a string based on if the username is valid, if valid then "success" is returned */ @@ -84,7 +84,7 @@ 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."; @@ -98,7 +98,7 @@ class Users{ } /** * Function checkPassword - * + * * @takes $pass * @return string Info: Returns a string based on if the password is valid, if valid then "success" is returned */ @@ -117,7 +117,7 @@ class Users{ } /** * Function confirmPassword - * + * * @takes $pass * @return string Info: Verify's $_POST["Password"] is the same as $_POST["ConfirmPass"] */ @@ -132,16 +132,16 @@ class Users{ } /** * Function checkEmail - * + * * @takes $email - * @return + * @return */ public function checkEmail( $email ) { if ( isset( $email ) ){ if ( !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."; @@ -230,4 +230,3 @@ class Users{ } } - \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/libinclude.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/libinclude.php index 86e7d3dbf..0d8606488 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/libinclude.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/libinclude.php @@ -3,6 +3,6 @@ // Base include file for library functions for AMS // *********************************************** function __autoload( $className ){ - require_once 'autoload/' . strtolower ($className) . '.php'; - } + require_once 'autoload/' . strtolower ( $className ) . '.php'; + } 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 abaa26747..e25bfd88b 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 @@ -1,6 +1,10 @@ ; This is a sample configuration file ; Comments start with ';', as in php.ini +[home] + +[login] + [register] title = "RYZOM CORE INGAME REGISTRATION" welcome_message = "Welcome! Please fill in the following fields to get your new Ryzom Core account:" diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/autoload/register.php b/code/ryzom/tools/server/ryzom_ams/www/html/autoload/register.php index 3821ccc3d..668b6a7a5 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/autoload/register.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/autoload/register.php @@ -16,7 +16,7 @@ if ( isset( $_POST["Username"] ) and isset( $_POST["Password"] ) and isset( $_PO } // if all are good then create user if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" ) and ( $email == "success" ) and ( isset( $_POST["TaC"] ) ) ){ - $edit = array( + $edit = array( 'name' => $_POST["Username"], 'pass' => $_POST["Password"], 'mail' => $_POST["Email"], @@ -29,7 +29,7 @@ if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" header( 'Location: email_sent.php' ); exit; }else{ - $pageElements = array( + $pageElements = array( 'GAME_NAME' => $GAME_NAME, 'WELCOME_MESSAGE' => $WELCOME_MESSAGE, 'USERNAME' => $user, @@ -42,7 +42,7 @@ if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" }else{ $pageElements['USERNAME_ERROR'] = 'FALSE'; } - + if ( $pass != "success" ){ $pageElements['PASSWORD_ERROR'] = 'TRUE'; }else{ @@ -64,7 +64,7 @@ if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" $pageElements['TAC_ERROR'] = 'TRUE'; } if ( helpers :: check_if_game_client() ){ - helpers :: loadtemplate( '../../ams_lib/ingame_templates/register.phtml', $pageElements ); + helpers :: loadtemplate( '../../ams_lib/ingame_templates/register.phtml', $pageElements ); }else{ helpers :: loadtemplate( 'templates/register.phtml', $pageElements ); } diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/css/charisma-app.css b/code/ryzom/tools/server/ryzom_ams/www/html/css/charisma-app.css index 1684e5fd9..7b6ae40fa 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/css/charisma-app.css +++ b/code/ryzom/tools/server/ryzom_ams/www/html/css/charisma-app.css @@ -452,7 +452,7 @@ background: #DEDEDE; } .login-header{ padding-top:30px; -height:190px; +height:120px; } .pull-left{ float:left !important; 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 new file mode 100644 index 000000000..1a9891e47 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/www/html/css/custom.css @@ -0,0 +1,17 @@ +.login-header +{ + height:190px; +} + +.brand img +{ + height:100%; + margin-bottom:-18px; + margin-top:-15px; + width:auto; +} + +#for-is-ajax +{ + display:none; +} diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/error.php b/code/ryzom/tools/server/ryzom_ams/www/html/error.php index e9e27be04..4d701a543 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/error.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/error.php @@ -73,7 +73,7 @@