Dotclear

Changeset 1087:0e5529e90076 for inc


Ignore:
Timestamp:
12/19/12 00:51:19 (13 years ago)
Author:
JcDenis
Branch:
twig
Message:
  • Current user is more verbose
Location:
inc/admin
Files:
3 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      
  • inc/admin/default-templates/index.html.twig

    r1079 r1087  
    1010{{ parent() }} 
    1111 
    12 {% if current_user.blog != current_blog.id and blog_count > 1 %} 
     12{% if current_user.default_blog != current_blog.id and blog_count > 1 %} 
    1313     <p><a href="index.php?default_blog=1" class="button">{{__('Make this blog my default blog')}}</a></p> 
    1414{% endif %} 
  • inc/admin/default-templates/layout.html.twig

    r1086 r1087  
    4040                    <a {%if current_page == 'index' %}class="active" {% endif %}href="index.php">{{__('My dashboard')}}</a><span> | </span> 
    4141                    <a {%if current_page == 'preferences' %}class="active" {% endif %}href="preferences.php">{{__('My preferences')}}</a><span> | </span> 
    42                     <a href="index.php?logout=1" class="logout">{{__('Logout %s')|format(current_user.id)}} <img src="images/logout.png" alt="" /></a> 
     42                    <a href="index.php?logout=1" class="logout">{{__('Logout %s')|format(current_user.id)}} <img src="{{theme_url}}images/logout.png" alt="" /></a> 
    4343               </div> 
    4444          </div> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map