Browse Source

- Fix account linking

- Add CSS3 Webkit support for the login page
pull/5/head
Jaussoin Timothée 14 years ago
parent
commit
dfa01721a5
  1. 7
      system/Datas/ConfVar.php
  2. 21
      system/User.php
  3. 6
      system/Widget/widgets/Login/Login.php
  4. 19
      system/Widget/widgets/Login/login.css

7
system/Datas/ConfVar.php

@ -33,7 +33,7 @@ class ConfVar extends DatajarBase {
$this->first = DatajarType::int();
}
public function get() {
public function get($element = false) {
$conf = array();
$arr = get_object_vars($this);
@ -42,7 +42,10 @@ class ConfVar extends DatajarBase {
$conf[$key] = $value->getval();
}
return $conf;
if($element == false)
return $conf;
else
return $conf[$element];
}
public function set($att, $val) {

21
system/User.php

@ -61,12 +61,12 @@ class User {
$sess->set('login', $login);
$sess->set('pass', $pass);
$this->username = $login;
$this->password = $pass;
$this->xmppSession = Jabber::getInstance($login);
$this->xmppSession->login($login, $pass);
$this->username = $login;
$this->password = $pass;
} else {
header('Location:'.BASE_URI.'index.php?q=disconnect&err=wrongpass');
exit;
@ -74,6 +74,21 @@ class User {
}
catch(MovimException $e){
echo $e->getMessage();
// If we've got an error on a new account
if($e->getCode() == 300)
{
global $sdb;
$conf = new ConfVar();
$sdb->load($conf, array(
'login' => $this->getLogin()
));
if($conf->get('first') == 0)
$conf->set('first', 2);
$sdb->save($conf);
header('Location:'.BASE_URI.'index.php?q=disconnect&err=wrongaccount');
exit;
}
return $e->getMessage();
}
}

6
system/Widget/widgets/Login/Login.php

@ -76,6 +76,12 @@ class Login extends WidgetBase {
'.t('Account successfully created').'
</div> ';
break;
case 'wrongaccount':
$warning = '
<div class="error">
'.t('Movim fail to authenticate. You entered wrong data').'
</div> ';
break;
}
if(!BROWSER_COMP)

19
system/Widget/widgets/Login/login.css

@ -3,10 +3,12 @@ html {
}
body {
background-color: #274950;
background-image: radial-gradient(center
45deg, circle closest-corner, #ffffff 0%, #717171 100%);
45deg, ellipse, #6E9EA8 0%, #274950 100%);
background-image: -moz-radial-gradient(center
45deg, ellipse, #6E9EA8 0%, #274950 100%);
background-image: -webkit-radial-gradient(50% 50%, ellipse, #6E9EA8, #274950);
background-repeat: no-repeat;
height: auto;
display: block;
@ -14,16 +16,16 @@ body {
}
#loginpage {
height: 500px;
width: 800px;
position: absolute;
top: 50%;
left: 50%;
margin-top: -250px;
margin-left: -400px;
display: block;
position: fixed;
height: 100px;
background-image: url(img/logo.png);
background-repeat: no-repeat;
background-position: top center;
margin: 0 auto;
width: 1024px;
top: 50%;
margin-top: -150px;
padding-top: 200px;
}
@ -39,6 +41,7 @@ body {
#loginpage input[type=submit] {
background: -moz-linear-gradient(top, #6E9EA8 0%, #274950 100%);
background: -webkit-linear-gradient(top, #6E9EA8 0%, #274950 100%);
color: white;
box-shadow: none;
}

Loading…
Cancel
Save