add language flags + js for activating them

--HG--
branch : quitta-gsoc-2013
This commit is contained in:
Quitta 2013-06-28 18:10:02 +02:00
parent 4755b7478f
commit 76e46c9fc4
8 changed files with 48 additions and 11 deletions

View file

@ -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{
}
}
}
}
}

View file

@ -4,6 +4,7 @@
[home]
[userlist]
userlist_info = "welcome to the userlist"
[login]
login_info = "Please login with your Username and Password."

View file

@ -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."

View file

@ -19,3 +19,10 @@
.navbar {
border-bottom: 0px;
}
.flags {
display: block;
position:relative;
left:290px;
top:28px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

View file

@ -101,10 +101,14 @@
<li><a href="index.php?page=logout">Logout</a></li>
</ul>
</div>
<div class="btn-group pull-right">
<div class="flags">
<img src="img/en.png" onclick="document.cookie='language=en';document.location.reload(true);"/>
<img src="img/fr.png" onclick="document.cookie='language=fr';document.location.reload(true);"/>
</div>
</div>
{/if}
<!-- user dropdown ends -->
</div>
</div>
</div>

View file

@ -3,7 +3,7 @@
<div class="row-fluid">
<div class="box span12">
<div class="box-header well">
<h2><i class="icon-info-sign"></i>User List</h2>
<h2><i class="icon-info-sign"></i>{$userlist_info}</h2>
<div class="box-icon">
<a href="#" class="btn btn-round" onclick="javascript:show_help('intro');return false;"><i class="icon-info-sign"></i></a>
<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>