Browse Source

- Use the username instead of the true name when adding a chatroom

pull/56/head
Jaussoin Timothée 10 years ago
parent
commit
a30bb591f1
  1. 2
      app/widgets/Rooms/Rooms.php
  2. 2
      app/widgets/Rooms/_rooms_add.tpl
  3. 9
      system/User.php

2
app/widgets/Rooms/Rooms.php

@ -52,7 +52,7 @@ class Rooms extends WidgetBase
$view = $this->tpl(); $view = $this->tpl();
$cd = new \Modl\ContactDAO; $cd = new \Modl\ContactDAO;
$view->assign('me', $cd->get());
$view->assign('username', $this->user->getUser());
Dialog::fill($view->draw('_rooms_add', true)); Dialog::fill($view->draw('_rooms_add', true));
} }

2
app/widgets/Rooms/_rooms_add.tpl

@ -11,7 +11,7 @@
<label>{$c->__('chatrooms.name')}</label> <label>{$c->__('chatrooms.name')}</label>
</div> </div>
<div> <div>
<input name="nick" placeholder="{$me->getTrueName()}" value="{$me->getTrueName()}"/>
<input name="nick" placeholder="{$username}" value="{$username}"/>
<label>{$c->__('chatrooms.nickname')}</label> <label>{$c->__('chatrooms.nickname')}</label>
</div> </div>
<!-- <!--

9
system/User.php

@ -38,9 +38,6 @@ class User {
if($session->active) { if($session->active) {
$this->username = $session->user.'@'.$session->host; $this->username = $session->user.'@'.$session->host;
//$this->reload();
//$this->sizelimit = (int)$config->sizelimit;
$this->userdir = DOCUMENT_ROOT.'/users/'.$this->username.'/'; $this->userdir = DOCUMENT_ROOT.'/users/'.$this->username.'/';
$this->useruri = BASE_URI.'users/'.$this->username.'/'; $this->useruri = BASE_URI.'users/'.$this->username.'/';
} }
@ -144,6 +141,12 @@ class User {
return $exp['server']; return $exp['server'];
} }
function getUser()
{
$exp = explodeJid($this->username);
return $exp['username'];
}
function getPass() function getPass()
{ {
return $this->password; return $this->password;

Loading…
Cancel
Save