Dotclear


Ignore:
Timestamp:
12/19/12 00:51:19 (13 years ago)
Author:
JcDenis
Branch:
twig
Message:
  • Current user is more verbose
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/class.dc.admincontext.php

    r1078 r1087  
    315315     protected function getCurrentUser() 
    316316     { 
    317           $this->protected_globals['current_user'] = $this->core->auth->userID() ? 
    318                array( 
    319                     'id'      => $this->core->auth->userID(), 
    320                     'admin'   => $this->core->auth->getInfo('user_admin'), 
    321                     'name'    => $this->core->auth->getInfo('user_name'), 
    322                     'firstname'    => $this->core->auth->getInfo('user_firstname'), 
    323                     'displayname'  => $this->core->auth->getInfo('user_displayname'), 
    324                     'url'     => $this->core->auth->getInfo('user_url'), 
    325                     'blog'    => $this->core->auth->getInfo('user_default_blog'), 
    326                     'lang'    => $this->core->auth->getInfo('user_lang'), 
    327                     'tz'      => $this->core->auth->getInfo('user_tz'), 
    328                     'creadt'  => $this->core->auth->getInfo('user_creadt'), 
    329                     'cn'      => $this->core->auth->getInfo('user_cn') 
    330                ) : 
    331                array( 
    332                     'id'      => '', 
    333                     'admin'   => '', 
    334                     'name'    => '', 
    335                     'firstname'    => '', 
    336                     'displayname'  => '', 
    337                     'url'     => '', 
    338                     'blog'    => '', 
    339                     'lang'    => 'en', 
    340                     'tz'      => '', 
    341                     'creadt'  => '', 
    342                     'cn'      => '', 
     317          $infos = array( 
     318               'pwd','name','firstname','displayname', 
     319               'email','url','default_blog','lang','tz', 
     320               'post_status','creadt','upddt','cn' 
     321          ); 
     322           
     323          $user = array( 
     324               'id' => '', 
     325               'super' => false, 
     326               'options' => array(), 
     327               'prefs' => array() 
     328          ); 
     329           
     330          foreach($infos as $i) { 
     331               $user[$i] = ''; 
     332          } 
     333           
     334          if ($this->core->auth->userID()) { 
     335           
     336               $user = array( 
     337                    'id' => $this->core->auth->userID(), 
     338                    'super' => $this->core->auth->isSuperAdmin(), 
     339                    'options' => $this->core->auth->getOptions() 
    343340               ); 
     341                
     342               foreach($infos as $i) { 
     343                    $user[$i] = $this->core->auth->getInfo('user_'.$i); 
     344               } 
     345                
     346               foreach($this->core->auth->user_prefs->dumpWorkspaces() as $ws => $prefs) { 
     347                    $user['prefs'][$ws] = $prefs->dumpPrefs(); 
     348               } 
     349          } 
     350           
     351          $this->protected_globals['current_user'] = $user; 
    344352     } 
    345353      
Note: See TracChangeset for help on using the changeset viewer.

Sites map