Changeset 6601

Show
Ignore:
Timestamp:
09/07/08 15:39:51 (3 months ago)
Author:
ethans
Message:

Adds FOPDISABLE option to amportal.conf. This will disable FOP on the web interfaces as well as server operations in retrieve_conf and freepbx_engine

References: 3170

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.5/amp_conf/bin/freepbx_engine

    r6595 r6601  
    216216                if [ -z "$FOPRUN" -o "$FOPRUN" == "true" -o "$FOPRUN" == "TRUE" -o "$FOPRUN" == "True" -o "$FOPRUN" == "yes" -o "$FOPRUN" == "YES" -o "$FOPRUN" == "Yes" ] 
    217217                then 
    218                         run_fop 
     218                        if [ -z "$FOPDISABLE" -o "$FOPDISABLE" == "false" -o "$FOPDISABLE" == "FALSE" -o "$FOPDISABLE" == "False" -o "$FOPDISABLE" == "no" -o "$FOPDISABLE" == "NO" -o "$FOPDISABLE" == "No" ] 
     219                        then 
     220                                run_fop 
     221                        fi 
    219222                fi 
    220223        ;; 
     
    231234                if [ -z "$FOPRUN" -o "$FOPRUN" == "true" -o "$FOPRUN" == "TRUE" -o "$FOPRUN" == "True" -o "$FOPRUN" == "yes" -o "$FOPRUN" == "YES" -o "$FOPRUN" == "Yes" ] 
    232235                then 
    233                         run_fop 
     236                        if [ -z "$FOPDISABLE" -o "$FOPDISABLE" == "false" -o "$FOPDISABLE" == "FALSE" -o "$FOPDISABLE" == "False" -o "$FOPDISABLE" == "no" -o "$FOPDISABLE" == "NO" -o "$FOPDISABLE" == "No" ] 
     237                        then 
     238                                run_fop 
     239                        fi 
    234240                fi 
    235241        ;; 
     
    253259        ;; 
    254260        *) 
     261                if [ -z "$FOPRUN" -o "$FOPRUN" == "true" -o "$FOPRUN" == "TRUE" -o "$FOPRUN" == "True" -o "$FOPRUN" == "yes" -o "$FOPRUN" == "YES" -o "$FOPRUN" == "Yes" ] 
     262                then 
     263                        if [ -z "$FOPDISABLE" -o "$FOPDISABLE" == "false" -o "$FOPDISABLE" == "FALSE" -o "$FOPDISABLE" == "False" -o "$FOPDISABLE" == "no" -o "$FOPDISABLE" == "NO" -o "$FOPDISABLE" == "No" ] 
     264                        then 
     265                                FOPUSAGE="start_fop|stop_fop|restart_fop|" 
     266                        fi 
     267                fi 
     268 
    255269                echo "-------------FreePBX Control Script-----------------------------------------------" 
    256270                echo 
    257                 echo "Usage:       amportal start|stop|restart|start_fop|stop_fop|restart_fop|kill|chown" 
     271                echo "Usage:       amportal start|stop|restart|${FOPUSAGE}kill|chown" 
    258272                echo 
    259273                echo "start:       Starts Asterisk and Flash Operator Panel server if enabled" 
    260274                echo "stop:        Gracefully stops Asterisk and the FOP server" 
    261275                echo "restart:     Stop and Starts" 
    262                 echo "start_fop:   Starts FOP server and Asterisk if not running" 
    263                 echo "stop_fop:    Stops FOP serverg" 
    264                 echo "restart_fop: Stops FOP server and Starts it and Asterisk if not running" 
     276                if [ -z "$FOPRUN" -o "$FOPRUN" == "true" -o "$FOPRUN" == "TRUE" -o "$FOPRUN" == "True" -o "$FOPRUN" == "yes" -o "$FOPRUN" == "YES" -o "$FOPRUN" == "Yes" ] 
     277                then 
     278                        if [ -z "$FOPDISABLE" -o "$FOPDISABLE" == "false" -o "$FOPDISABLE" == "FALSE" -o "$FOPDISABLE" == "False" -o "$FOPDISABLE" == "no" -o "$FOPDISABLE" == "NO" -o "$FOPDISABLE" == "No" ] 
     279                        then 
     280 
     281                                echo "start_fop:   Starts FOP server and Asterisk if not running" 
     282                                echo "stop_fop:    Stops FOP serverg" 
     283                                echo "restart_fop: Stops FOP server and Starts it and Asterisk if not running" 
     284                        fi 
     285                fi 
    265286                echo "kill:        Kills Asterisk and the FOP server" 
    266287                echo "chown:       Sets appropriate permissions on files" 
  • freepbx/branches/2.5/amp_conf/bin/retrieve_conf

    r6595 r6601  
    717717// script to write op_server.cfg file from mysql  
    718718// 
    719 $script = $amp_conf['AMPBIN'].'/retrieve_op_conf_from_mysql.pl '.$amportalconf.' '.rtrim($asterisk_conf['astetcdir'],DIRECTORY_SEPARATOR); 
    720 exec($script, $output, $ret); 
    721 if ($ret) { 
    722         fatal(sprintf(_("retrieve_op_conf_from_mysql.pl returned with an error code %s"),$ret)); 
    723 
    724  
     719if(!$amp_conf['FOPDISABLE'])  { 
     720        $script = $amp_conf['AMPBIN'].'/retrieve_op_conf_from_mysql.pl '.$amportalconf.' '.rtrim($asterisk_conf['astetcdir'],DIRECTORY_SEPARATOR); 
     721        exec($script, $output, $ret); 
     722        if ($ret) { 
     723                fatal(sprintf(_("retrieve_op_conf_from_mysql.pl returned with an error code %s"),$ret)); 
     724        } 
     725
    725726// generate configuration files 
    726727// 
  • freepbx/branches/2.5/amp_conf/htdocs/admin/functions.inc.php

    r6595 r6601  
    729729        'AMPENABLEDEVELDEBUG'=> array('bool' , false), 
    730730        'AMPMPG123'      => array('bool' , true), 
     731        'FOPDISABLE'      => array('bool' , false), 
    731732        'ZAP2DAHDICOMPAT' => array('bool' , false), 
    732733); 
     
    14941495         
    14951496         
    1496         if ($amp_conf['FOPRUN']) { 
     1497        if ($amp_conf['FOPRUN'] && !$amp_conf['FOPDISABLE']) { 
    14971498                //bounce op_server.pl 
    14981499                $wOpBounce = $amp_conf['AMPBIN'].'/bounce_op.sh'; 
  • freepbx/branches/2.5/amp_conf/htdocs/admin/views/freepbx.php

    r6477 r6601  
    165165        print_sub_tool( _("Admin")   , "config.php", $currentFile=='config.php' ); 
    166166        print_sub_tool( _("Reports")   , "reports.php", $currentFile=='reports.php' ); 
    167         print_sub_tool( _("Panel")     , "panel.php"  , $currentFile=='panel.php' ); 
     167        if(!$amp_conf["FOPDISABLE"])  { 
     168                print_sub_tool( _("Panel")     , "panel.php"  , $currentFile=='panel.php' ); 
     169        } 
    168170        print_sub_tool( _("Recordings"), "../recordings/index.php"  ,0, NULL, "ari" ); 
    169171        print_sub_tool( _("Help"), "http://www.freepbx.org/freepbx-help-system$help_args"  ,0, NULL, "help" ); 
  • freepbx/branches/2.5/amportal.conf

    r6597 r6601  
    200200# less frequently (such as Astersisk Uptime) based on the INFO value 
    201201 
     202# FOPDISABLE=true|false # DEFAULT VALUE false 
     203# Disables FOP in interface and retrieve_conf.  Usefull for sqlite3 or if you don't want FOP. 
     204 
    202205# ZAP2DAHDICOMPAT=true|false 
    203206# DEFAULT VALUE: false 
  • freepbx/branches/2.5/install_amp

    r6231 r6601  
    125125        out("  --install-moh            Install default music-on-hold files (normally doesn't, unless "); 
    126126        out("                           it's a new installation)"); 
     127        out("  --install-fop=false      Don't install FOP and don't display it anywhere on the interface"); 
    127128        //out("  --make-links-devel       Make links to files in the source directory instead of copying"); 
    128129        //out("                           (intended for developers only)"); 
     
    569570// **** Parse out command-line options 
    570571$shortopts = "h?u:p:"; 
    571 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine=","webroot=","install-moh","make-links-devel","skip-module-install"); 
     572$longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine=","webroot=","install-moh","install-fop","make-links-devel","skip-module-install"); 
    572573 
    573574$args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); 
     
    584585 
    585586$install_moh = false; 
     587$install_fop = true; 
    586588$make_links = false; 
    587589$module_install = true; 
     
    642644                case "--install-moh": 
    643645                        $install_moh = true; 
     646                break; 
     647                case "--install-fop": 
     648                        if($arg[1] != "false")  { 
     649                                $install_fop = true; 
     650                                out("FOP will be installed and activated."); 
     651                        } 
     652                        else  { 
     653                                out("FOP will be deactivated in the interface.  Set FOPDISABLE=false in amportal.conf to change later."); 
     654 
     655                        } 
     656 
    644657                break; 
    645658                case "--make-links-devel": 
     
    785798        $amp_conf["AMPDBNAME"] = $dbname; 
    786799} 
    787          
     800if(!$install_fop)  { // Set from --install-fop parameter; Add it to amportal.conf 
     801        out("Adding FOPDISABLE option to amportal.conf"); 
     802        $amp_conf["FOPDISABLE"] = "true"; 
     803
     804// If they pre-set this in their amportal.conf or this is an upgrade, we should honor it as well 
     805if($amp_conf["FOPDISABLE"] == "true" || $amp_conf["FOPDISABLE"] == "YES" || $amp_conf["FOPDISABLE"] == "yes" || $amp_conf["FOPDISABLE"] == "Yes" || $amp_conf["FOPDISABLE"] == "y" )  { 
     806        $install_fop = false; 
     807}        
    788808// write amportal.conf 
    789809write_amportal_conf(AMP_CONF, $amp_conf); 
     
    10941114$version = install_getversion(); 
    10951115 
    1096 // **** Bounce FOP 
    1097 outn("Restarting Flash Operator Panel.."); 
    1098 exec('su - asterisk -c "'.$amp_conf["AMPBIN"].'/bounce_op.sh"'); 
    1099 out("OK"); 
    1100  
     1116if($install_fop && $amp_conf["FOPRUN"])  { 
     1117        // **** Bounce FOP 
     1118        outn("Restarting Flash Operator Panel.."); 
     1119        exec('su - asterisk -c "'.$amp_conf["AMPBIN"].'/bounce_op.sh"'); 
     1120        out("OK"); 
     1121
    11011122 
    11021123// Now force an install for all modules that are packaged with the tarball 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads