Changeset 2071 in ExiteCMS


Ignore:
Timestamp:
11/26/08 16:24:46 (3 years ago)
Author:
WanWizard
Message:

optimized the member selection code in the administrators admin module
modified the layout in the administrators admin module
added new common themes as svn:externals
fixed issue with permature expiring of session cookies
disabled wikilink parsing in user signatures

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/administrators.php

    r2033 r2071  
    8181 
    8282// get the list of members with administrator or webmaster level 
    83 $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_level>='102' AND user_status = '0' ORDER BY user_level DESC, user_name"); 
     83$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_status = '0' ORDER BY user_level DESC, user_name"); 
    8484$variables['admins'] = array(); 
    85 while ($data = dbarray($result)) { 
    86     $data['user_rights'] = $data['user_rights'] ? str_replace(".", " ", $data['user_rights']) : "".$locale['405']; 
    87     $data['user_level'] = getuserlevel($data['user_level']); 
    88     if ($data['user_id'] == "1" || $data['user_id'] == $userdata['user_id']) {  
    89         // no editing of the webmaster or the members own rights 
    90         $data['can_edit'] = false; 
    91     } elseif ($data['user_level'] != "103") { 
    92         // admins can always be edited 
    93         $data['can_edit'] = true; 
    94     } else {  
    95         // catch-all, no editing possible! 
    96         $data['can_edit'] = false;  
    97     } 
    98     $variables['admins'][] = $data; 
    99 } 
    100  
    101 // get the list of all members (remove the user himself from the list!) 
    102 $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_status = '0' ORDER BY user_name"); 
    10385$variables['users'] = array(); 
    10486while ($data = dbarray($result)) { 
    105     if ($data['user_id'] != $userdata['user_id']) $variables['users'][] = $data; 
     87    if ($data['user_level'] >= 102) { 
     88        // it's a webmaster or administrator 
     89        $data['user_rights'] = $data['user_rights'] ? str_replace(".", " ", $data['user_rights']) : "".$locale['405']; 
     90        $data['user_level'] = getuserlevel($data['user_level']); 
     91        if ($data['user_id'] == "1" || $data['user_id'] == $userdata['user_id']) {  
     92            // no editing of the webmaster or the members own rights 
     93            $data['can_edit'] = false; 
     94        } elseif ($data['user_level'] != "103") { 
     95            // admins can always be edited 
     96            $data['can_edit'] = true; 
     97        } else {  
     98            // catch-all, no editing possible! 
     99            $data['can_edit'] = false;  
     100        } 
     101        $variables['admins'][] = $data; 
     102    } else { 
     103        // it's a member 
     104        $variables['users'][] = $data; 
     105    } 
    106106} 
    107107 
  • trunk/includes/core_functions.php

    r2028 r2071  
    2121// disable error reporting, we don't want to give anything away 
    2222error_reporting(E_USER_ERROR); 
     23 
     24// make sure we have enough memory to work with (independent of the php.ini setting) 
     25ini_set('memory_limit', '32M'); 
    2326 
    2427// check the environment to see if we can run 
  • trunk/includes/session_functions.php

    r2019 r2071  
    4646// start the session 
    4747session_start(); 
     48 
     49// update the timestamp of the session cookie, we want expiry after the last page load, not after the session has started! 
     50setcookie(ini_get("session.name"), session_id(), time()+ini_get("session.gc_maxlifetime")); 
    4851 
    4952// if the user changed the state of a panel, a cookie has been created to record the new state 
     
    6871} 
    6972 
     73// mark all variables in flash as used, so they get deleted at the end of this page request 
     74foreach($_SESSION['_flash'] as $key => $value) { 
     75    $_SESSION['_flash'][$key]['used'] = true; 
     76} 
     77 
     78 
    7079/*---------------------------------------------------+ 
    7180| Session related global functions                   | 
     
    123132        return false; 
    124133    } else { 
    125         // mark the info in the session flash as used 
    126         $_SESSION['_flash'][$name]['used'] = true; 
    127134        return $_SESSION['_flash'][$name]['var']; 
    128135    } 
  • trunk/includes/templates/admin.administrators.tpl

    r1935 r2071  
    1818{*                                                                         *} 
    1919{***************************************************************************} 
    20 {include file="_opentable.tpl" name=$_name title=$locale.400 state=$_state style=$_style} 
    21     <table align='center' cellpadding='0' cellspacing='1' width='500' class='tbl-border'> 
    22         <tr> 
    23             <td class='tbl2'> 
    24                 <b>{$locale.401}</b> 
    25             </td> 
    26             <td align='center' width='1%' class='tbl2' style='white-space:nowrap'> 
    27                 <b>{$locale.402}</b> 
    28             </td> 
    29             <td align='center' width='1%' class='tbl2' style='white-space:nowrap'> 
    30                 <b>{$locale.403}</b> 
    31             </td> 
    32         </tr> 
    33         {section name=id loop=$admins} 
    34             <tr> 
    35                 <td class='{cycle values='tbl1,tbl2' advance=no}'> 
    36                     <span title='{$admins[id].user_rights}' style='cursor:hand;'>{$admins[id].user_name}</span> 
    37                 </td> 
    38                 <td align='center' width='1%' class='{cycle values='tbl1,tbl2' advance=no}' style='white-space:nowrap'> 
    39                     {$admins[id].user_level} 
    40                 </td> 
    41                 <td align='center' width='1%' class='{cycle values='tbl1,tbl2'}' style='white-space:nowrap'> 
    42                 {if $admins[id].can_edit && $admins[id].user_id != "1"} 
    43                     <a href='{$smarty.const.FUSION_SELF}{$aidlink}&amp;edit={$admins[id].user_id}'><img src='{$smarty.const.THEME}images/page_edit.gif' alt='{$locale.406}' title='{$locale.406}' /></a>&nbsp; 
    44                     <a href='{$smarty.const.FUSION_SELF}{$aidlink}&amp;remove={$admins[id].user_id}'><img src='{$smarty.const.THEME}images/page_delete.gif' alt='{$locale.407}' title='{$locale.407}' /></a> 
    45                 {/if} 
    46                 </td> 
    47             </tr> 
    48         {/section} 
    49         {section name=id loop=$users} 
    50             {if $smarty.section.id.first} 
    51             <tr> 
    52                 <td align='center' colspan='3' class='tbl1'> 
    53                     <form name='adminform' method='post' action='{$smarty.const.FUSION_SELF}{$aidlink}'> 
    54                         <select name='user_id' class='textbox'> 
    55             {/if} 
    56                             <option value='{$users[id].user_id}'>{$users[id].user_name}</option> 
    57             {if $smarty.section.id.last} 
    58                         </select> 
    59                         <input type='submit' name='edit_rights' value='{$locale.410}' class='button' /> 
    60                         <br /> 
    61                         <input type='checkbox' name='all_rights' value='1' /> {$locale.411} 
    62                         {if $userdata.user_id == "1"} 
    63                             <br /> 
    64                             <input type='checkbox' name='make_super' value='1' /> {$locale.user3|string_format:$locale.412} 
    65                         {/if} 
    66                     </form> 
    67                 </td> 
    68             </tr> 
    69             {/if} 
    70         {/section} 
    71     </table> 
    72 {include file="_closetable.tpl"} 
    7320{if $show_edit_panel} 
    7421    {assign var='page' value=''} 
     
    12976        {/if} 
    13077    {/section} 
     78{else} 
     79    {include file="_opentable.tpl" name=$_name title=$locale.400 state=$_state style=$_style} 
     80        <table align='center' cellpadding='0' cellspacing='1' width='500' class='tbl-border'> 
     81            <tr> 
     82                <td class='tbl2'> 
     83                    <b>{$locale.401}</b> 
     84                </td> 
     85                <td align='center' width='1%' class='tbl2' style='white-space:nowrap'> 
     86                    <b>{$locale.402}</b> 
     87                </td> 
     88                <td align='center' width='1%' class='tbl2' style='white-space:nowrap'> 
     89                    <b>{$locale.403}</b> 
     90                </td> 
     91            </tr> 
     92            {section name=id loop=$admins} 
     93                <tr> 
     94                    <td class='{cycle values='tbl1,tbl2' advance=no}'> 
     95                        <span title='{$admins[id].user_rights}' style='cursor:hand;'>{$admins[id].user_name}</span> 
     96                    </td> 
     97                    <td align='center' width='1%' class='{cycle values='tbl1,tbl2' advance=no}' style='white-space:nowrap'> 
     98                        {$admins[id].user_level} 
     99                    </td> 
     100                    <td align='center' width='1%' class='{cycle values='tbl1,tbl2'}' style='white-space:nowrap'> 
     101                    {if $admins[id].can_edit && $admins[id].user_id != "1"} 
     102                        <a href='{$smarty.const.FUSION_SELF}{$aidlink}&amp;edit={$admins[id].user_id}'><img src='{$smarty.const.THEME}images/page_edit.gif' alt='{$locale.406}' title='{$locale.406}' /></a>&nbsp; 
     103                        <a href='{$smarty.const.FUSION_SELF}{$aidlink}&amp;remove={$admins[id].user_id}'><img src='{$smarty.const.THEME}images/page_delete.gif' alt='{$locale.407}' title='{$locale.407}' /></a> 
     104                    {/if} 
     105                    </td> 
     106                </tr> 
     107            {/section} 
     108            {section name=id loop=$users} 
     109                {if $smarty.section.id.first} 
     110                <tr> 
     111                    <td align='center' colspan='3' class='tbl1'> 
     112                        <form name='adminform' method='post' action='{$smarty.const.FUSION_SELF}{$aidlink}'> 
     113                            <select name='user_id' class='textbox'> 
     114                {/if} 
     115                                <option value='{$users[id].user_id}'>{$users[id].user_name}</option> 
     116                {if $smarty.section.id.last} 
     117                            </select> 
     118                            <input type='submit' name='edit_rights' value='{$locale.410}' class='button' /> 
     119                            <br /> 
     120                            <input type='checkbox' name='all_rights' value='1' /> {$locale.411} 
     121                            {if $userdata.user_id == "1"} 
     122                                <br /> 
     123                                <input type='checkbox' name='make_super' value='1' /> {$locale.user3|string_format:$locale.412} 
     124                            {/if} 
     125                        </form> 
     126                    </td> 
     127                </tr> 
     128                {/if} 
     129            {/section} 
     130        </table> 
     131    {include file="_closetable.tpl"} 
    131132{/if} 
    132133{literal} 
  • trunk/themes

    • Property svn:externals
      •  

        old new  
        33DIV https://www.exitecms.org/svn-auth/ExiteCMS/themes/public/DIV/php-files/themes/DIV 
        44Hezo https://www.exitecms.org/svn-auth/ExiteCMS/themes/public/Hezo/php-files/themes/Hezo 
         5ChristmasDays https://www.exitecms.org/svn-auth/ExiteCMS/themes/public/ChristmasDays/php-files/themes/ChristmasDays 
         6Hobugt https://www.exitecms.org/svn-auth/ExiteCMS/themes/public/Hobugt/php-files/themes/Hobugt 
         7Localize https://www.exitecms.org/svn-auth/ExiteCMS/themes/public/Localize/php-files/themes/Localize 
         8Luna https://www.exitecms.org/svn-auth/ExiteCMS/themes/public/Luna/php-files/themes/Luna 
Note: See TracChangeset for help on using the changeset viewer.