Changeset 1061

Show
Ignore:
Timestamp:
09/19/08 05:45:55 (4 months ago)
Author:
areski
Message:

changes for reset on PHPConfig

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/admin/Public/cls_phpconfig_html.php

    r1051 r1061  
    2727include_once ("../lib/admin.smarty.php"); 
    2828 
    29 if (! has_rights (ACX_PBXCONFIG)){  
     29if (! has_rights (ACX_ADMINISTRATOR)){  
    3030        Header ("HTTP/1.0 401 Unauthorized"); 
    3131        Header ("Location: PP_error.php?c=accessdenied");           
  • trunk/admin/Public/cls_phpconfig.php

    r1023 r1061  
    428428    function OC_checkAccess($user) 
    429429    { 
    430  
    431430        $accessFile = array(); 
    432431 
  • trunk/admin/Public/form_data/FG_var_user.inc

    r1033 r1061  
    4747$right_list["15"] = array( gettext("INVOICES"), "16384"); 
    4848$right_list["16"] = array( gettext("SUPPORT"), "32768"); 
    49 $right_list["17"] = array( gettext("PBX-CONFIG"), "65536"); 
     49// removed! $right_list["17"] = array( gettext("Next Menu"), "65536"); 
    5050 
    5151$len_right_list = count($right_list); 
  • trunk/admin/Public/phpconfig.php

    r1033 r1061  
    1616include_once ("../lib/admin.defines.php"); 
    1717include_once ("../lib/admin.module.access.php"); 
     18include_once ("../lib/regular_express.inc"); 
     19include_once ("../lib/phpagi/phpagi-asmanager.php"); 
    1820include_once ("../lib/admin.smarty.php"); 
    1921 
    20 if (! has_rights (ACX_PBXCONFIG)){  
     22 
     23if (! has_rights (ACX_ADMINISTRATOR)){  
    2124        Header ("HTTP/1.0 401 Unauthorized"); 
    2225        Header ("Location: PP_error.php?c=accessdenied");           
     
    163166 
    164167        // check if person is authorized to execute re-read configuration 
    165         $access_result = $conf->OC_checkAccess($_SESSION['valid_user']); 
    166  
     168        //$access_result = $conf->OC_checkAccess($_SESSION['valid_user']); 
     169                $access_result = true; 
     170                 
    167171        if ($access_result) 
    168172        { 
    169173            // re-read configuration 
    170             @system($conf->_OC_reset_cmd, $result); 
     174            /*@system($conf->_OC_reset_cmd, $result); 
    171175            if ($result == 0) 
    172176            { 
     
    176180            { 
    177181                echo "<br>Reset failed.<br>"; 
    178             } 
     182            }*/ 
     183             
     184            $as = new AGI_AsteriskManager(); 
     185                        $res = $as->connect(MANAGER_HOST,MANAGER_USERNAME,MANAGER_SECRET); 
     186                        if ($res) 
     187                                $res = $as->Command('reload'); 
     188                         
     189                        if ($res) { 
     190                echo "<br>Reset succeded.<br>"; 
     191            } else { 
     192                echo "<br>Reset failed.<br>"; 
     193            } 
     194            $as->disconnect(); 
    179195 
    180196        } 
  • trunk/admin/Public/templates/default/main.tpl

    r1051 r1061  
    542542                                <li><a href="A2B_phpsysinfo.php?section=11">{php} echo "phpSysInfo";{/php}</a></li> 
    543543                                <li><a href="A2B_phpinfo.php?section=11">{php} echo "phpInfo";{/php}</a></li> 
     544                                <li><a href="phpconfig.php?dir=/etc/asterisk&section=11">{php} echo gettext("Asterisk config");{/php}</a></li> 
    544545                        </ul></li> 
    545546                </ul> 
     
    549550        {/if} 
    550551         
    551          
    552         {if ($ACXPBXCONFIG  > 0)} 
    553         <div class="toggle_menu"> 
    554         <li><a href="javascript:;" class="toggle_menu" target="_self"><img id="img15" 
    555         {if ($section == "15")} 
    556         src="templates/{$SKIN_NAME}/images/minus.gif" 
    557         {else} 
    558         src="templates/{$SKIN_NAME}/images/plus.gif" 
    559         {/if} onmouseover="this.style.cursor='hand';" WIDTH="9" HEIGHT="9">&nbsp; <strong>{php} echo gettext("PBX-CONFIG");{/php}</strong></a></li> 
    560                 <div class="tohide" 
    561         {if ($section =="15")} 
    562                 style=""> 
    563         {else} 
    564                 style="display:none;"> 
    565         {/if} 
    566                 <ul> 
    567                         <li><ul> 
    568                          
    569                                 <li><a href="phpconfig.php?file=sip.conf&section=15&section_conf=sip.conf">sip.conf</a></li> 
    570                                 <li><a href="phpconfig.php?file=iax.conf&section=15&section_conf=iax.conf">iax.conf</a></li> 
    571                                 <li><a href="phpconfig.php?file=extensions.conf&section=15&section_conf=extensions.conf">extensions.conf</a></li> 
    572                                 <li><a href="phpconfig.php?dir=/etc/asterisk&section=15">{php} echo gettext("All config files");{/php}</a></li> 
    573                                  
    574                         </ul></li> 
    575                 </ul> 
    576         </div> 
    577         </div> 
    578          
    579         {/if} 
    580552         
    581553        <li><a href="#" target="_self"></a></a></li> 
  • trunk/common/lib/admin.module.access.php

    r1033 r1061  
    3737define ("ACX_INVOICING",                                16384);         // 1 << 13 
    3838define ("ACX_SUPPORT",                                  32768);         // 1 << 14 
    39 define ("ACX_PBXCONFIG",                              65536);         // 1 << 15 
     39// define ("ACX_PBXCONFIG",                           65536);         // 1 << 15 
    4040 
    4141header("Expires: Sat, Jan 01 2000 01:01:01 GMT"); 
     
    191191$ACXINVOICING2                  = has_rights (ACX_INVOICING); 
    192192$ACXSUPPORT                     = has_rights (ACX_SUPPORT); 
    193 $ACXPBXCONFIG                   = has_rights (ACX_PBXCONFIG); 
    194193 
    195194 
  • trunk/common/lib/admin.smarty.php

    r1033 r1061  
    5555$smarty->assign("ACXINVOICING", $ACXINVOICING); 
    5656$smarty->assign("ACXINVOICING2", $ACXINVOICING2); 
    57 $smarty->assign("ACXPBXCONFIG", $ACXPBXCONFIG); 
    5857 
    5958 


Google