Beispiel #1
0
 function main_motd($eventData)
 {
     global $gEnv, $hui_titlebar, $hui_mainframe, $amp_locale;
     OpenLibrary('sites.library');
     $site = new Site($gEnv['root']['db'], $gEnv['site']['id'], $gEnv['site']['db']);
     $xml_def = '<vertgroup><name>motd</name>
       <children>
     
         <form><name>motd</name>
           <args>
             <method>post</method>
             <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'motd', ''), array('pass', 'setmotd', '')))) . '</action>
           </args>
           <children>
     
             <grid><name>motd</name>
     
               <children>
     
                 <label row="0" col="0" halign="" valign="top"><name>label</name>
                   <args>
                     <label type="encoded">' . urlencode($amp_locale->GetStr('motd.label')) . '</label>
                   </args>
                 </label>
     
                 <text row="0" col="1"><name>motd</name>
                   <args>
                     <rows>10</rows>
                     <cols>80</cols>
                     <disp>pass</disp>
                     <value type="encoded">' . urlencode($site->GetMotd()) . '</value>
                   </args>
                 </text>
     
               </children>
     
             </grid>
     
           </children>
         </form>
     
         <horizbar><name>hb</name></horizbar>
     
         <button>
           <name>apply</name>
           <args>
             <horiz>true</horiz>
             <frame>false</frame>
             <themeimage>button_ok</themeimage>
             <label type="encoded">' . urlencode($amp_locale->GetStr('set_motd.submit')) . '</label>
             <formsubmit>motd</formsubmit>
             <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'motd', ''), array('pass', 'setmotd', '')))) . '</action>
           </args>
         </button>
     
       </children>
     </vertgroup>';
     $hui_mainframe->AddChild(new HuiXml('page', array('definition' => $xml_def)));
     $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('motd.title');
 }
Beispiel #2
0
 public function getStyle()
 {
     $result = array();
     OpenLibrary('configman.library');
     $cfg_file = new ConfigFile(CONFIG_PATH . $this->mStyleName . '.huistyle');
     if ($cfg_file->Opened()) {
         $values = $cfg_file->ValuesArray();
         while (list($key, $val) = each($values)) {
             $key = trim($key);
             $val = trim($val);
             $realkey = strtolower(substr($key, strpos($key, '.') + 1));
             if ($realkey != 'name') {
                 $result[$realkey]['value'] = $val;
                 $result[$realkey]['base'] = $this->mStyleName;
             }
         }
     } else {
         import('com.solarix.ampoliros.io.log.Logger');
         $log = new Logger(AMP_LOG);
         $log->LogEvent('ampoliros.huithemes_library.huistyle_class.getstyle', 'Unable to open style file ' . CONFIG_PATH . $this->mStyleName . '.huistyle', LOGGER_ERROR);
     }
     return $result;
 }
Beispiel #3
0
 public function initTheme()
 {
     $result = false;
     if (strlen($this->mTheme)) {
         global $gEnv;
         import('com.solarix.ampoliros.core.Ampoliros');
         $amp = Ampoliros::instance('Ampoliros');
         if ($this->mTheme == 'default') {
             $this->mTheme = $gEnv['hui']['theme']['default'];
         }
         if ($this->mTheme != 'userdefined') {
             if (file_exists(CONFIG_PATH . $this->mTheme . '.huitheme')) {
                 $this->mThemeFile = CONFIG_PATH . $this->mTheme . '.huitheme';
             } else {
                 $this->mTheme = $gEnv['hui']['theme']['default'];
                 $this->mThemeFile = CONFIG_PATH . $gEnv['hui']['theme']['default'] . '.huitheme';
             }
             OpenLibrary('configman.library');
             $cfg_file = new ConfigFile($this->mThemeFile);
             if ($cfg_file->opened()) {
                 $this->mIconsSetName = $cfg_file->Value('THEME.ICONSSET');
                 $this->mColorsSetName = $cfg_file->Value('THEME.COLORSSET');
                 $this->mStyleName = $cfg_file->Value('THEME.STYLE');
             } else {
                 import('com.solarix.ampoliros.io.log.Logger');
                 $log = new Logger(AMP_LOG);
                 $log->LogEvent('ampoliros.huithemes_library.huitheme_class.inittheme', 'Unable to open theme configuration file ' . $this->mThemeFile, LOGGER_ERROR);
             }
         } else {
             $this->mIconsSetName = $this->mUserSettings['iconsset'];
             $this->mColorsSetName = $this->mUserSettings['colorsset'];
             $this->mStyleName = $this->mUserSettings['stylename'];
         }
         $this->mIconsSetBase = CGI_URL . 'icons/' . $this->mIconsSetName . '/';
         $this->mIconsBase = CGI_URL . 'icons/';
         $this->mIconsSetDir = CGI_PATH . 'icons/' . $this->mIconsSetName . '/';
         $this->mStyleBase = CGI_URL . 'styles/';
         $this->mStyleDir = CGI_PATH . 'styles/' . $this->mStyleName . '/';
         $hui_colors = new HuiColorsSet($this->mrAmpDb, $this->mColorsSetName);
         $hui_icons = new HuiIconsSet($this->mrAmpDb, $this->mIconsSetName);
         $hui_style = new HuiStyle($this->mrAmpDb, $this->mStyleName);
         if ($amp->getState() != Ampoliros::STATE_SETUP) {
             $cached_iconsset = new CachedItem($this->mrAmpDb, 'ampoliros', 'huiiconsset-' . $this->mIconsSetName);
             $cached_colorsset = new CachedItem($this->mrAmpDb, 'ampoliros', 'huicolorsset-' . $this->mColorsSetName);
             $cached_style = new CachedItem($this->mrAmpDb, 'ampoliros', 'huistyle-' . $this->mStyleName);
             $this->mIconsSet = unserialize($cached_iconsset->Retrieve());
             $this->mColorsSet = unserialize($cached_colorsset->Retrieve());
             $this->mStyle = unserialize($cached_style->Retrieve());
         }
         if (!$this->mIconsSet or !$this->mColorsSet or !$this->mStyle) {
             if ($gEnv['hui']['theme']['default'] == $this->mTheme) {
                 $this->mColorsSet = $hui_colors->GetColorsSet();
                 $this->mIconsSet = $hui_icons->GetIconsSet();
                 $this->mStyle = $hui_style->GetStyle();
             } else {
                 OpenLibrary('configman.library');
                 $def_cfg_file = new ConfigFile(CONFIG_PATH . $gEnv['hui']['theme']['default'] . '.huitheme');
                 if ($def_cfg_file->Opened()) {
                     $def_icons_set_name = $def_cfg_file->Value('THEME.ICONSSET');
                     $def_colors_set_name = $def_cfg_file->Value('THEME.COLORSSET');
                     $def_style_name = $def_cfg_file->Value('THEME.STYLE');
                 } else {
                     import('com.solarix.ampoliros.io.log.Logger');
                     $log = new Logger(AMP_LOG);
                     $log->LogEvent('ampoliros.huithemes_library.huitheme_class.inittheme', 'Unable to open default theme configuration file ' . CONFIG_PATH . $gEnv['hui']['theme']['default'] . '.huitheme', LOGGER_ERROR);
                 }
                 $hui_def_colors = new HuiColorsSet($this->mrAmpDb, $def_colors_set_name);
                 $hui_def_icons = new HuiIconsSet($this->mrAmpDb, $def_icons_set_name);
                 $hui_def_style = new HuiStyle($this->mrAmpDb, $def_style_name);
                 $this->mColorsSet = $this->DefOpts($hui_def_colors->GetColorsSet(), $hui_colors->GetColorsSet());
                 $this->mIconsSet = $this->DefOpts($hui_def_icons->GetIconsSet(), $hui_icons->GetIconsSet());
                 $this->mStyle = $this->DefOpts($hui_def_style->GetStyle(), $hui_style->GetStyle());
             }
             while (list($style_name, $style_item) = each($this->mStyle)) {
                 $this->mStyle[$style_name] = $this->mStyleBase . $style_item['base'] . '/' . $style_item['value'];
             }
             if ($amp->getState() != Ampoliros::STATE_SETUP) {
                 $cached_iconsset->Store(serialize($this->mIconsSet));
                 $cached_colorsset->Store(serialize($this->mColorsSet));
                 $cached_style->Store(serialize($this->mStyle));
             }
         }
     }
     return $result;
 }
<?php

OpenLibrary('misc.library');
recremovedir(MODULE_PATH . 'ezpdflib/fonts');
dircopy($this->basedir . '/extras/fonts/', MODULE_PATH . 'ezpdflib/fonts/');
Beispiel #5
0
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: index.php,v 1.10 2004-07-08 15:04:25 alex Exp $
require './auth.php';
OpenLibrary('hui.library');
if (strlen($_SESSION['AMP_AUTH_USER'])) {
    OpenLibrary('sessionkey.hui', HANDLER_PATH);
    $empty = new HuiSessionKey('mainpage', array('sessionobjectnopage' => 'true'));
    if (!strlen($empty->mValue) or !file_exists($empty->mValue)) {
        $main_page_url = 'main.php';
    } else {
        $main_page_url = build_events_call_string($empty->mValue, array(array('main', 'default', ''))) . '&amp;act=def';
    }
    header('P3P: CP="CUR ADM OUR NOR STA NID"');
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Ampoliros - <?php 
    echo $env["sitedata"]["sitename"];
    ?>
</title>
Beispiel #6
0
    public function abort($text, $forceInterface)
    {
        global $gEnv;
        OpenLibrary('hui.library');
        if (strlen($forceInterface)) {
            $interface = $forceInterface;
        } else {
            $interface = $this->interface;
        }
        if ($interface == Ampoliros::INTERFACE_EXTERNAL) {
            if (isset($gEnv['runtime']['external_interface_error_handler']) and function_exists($gEnv['runtime']['external_interface_error_handler'])) {
                $func = $gEnv['runtime']['external_interface_error_handler'];
                $func($text);
            } else {
                $interface = Ampoliros::INTERFACE_WEB;
                $this->interface = Ampoliros::INTERFACE_WEB;
            }
        }
        switch ($interface) {
            case Ampoliros::INTERFACE_GUI:
            case Ampoliros::INTERFACE_UNKNOWN:
            case Ampoliros::INTERFACE_REMOTE:
            case Ampoliros::INTERFACE_EXTERNAL:
                break;
            case Ampoliros::INTERFACE_CONSOLE:
                echo "\n" . $text . "\n";
                break;
            case Ampoliros::INTERFACE_WEB:
                $reg = Registry::instance();
                $tmp_hui = new Hui($reg->getEntry('amp.root.db'));
                $tmp_hui->LoadWidget('empty');
                //$tmp_elem = new HuiEmpty('empty');
                if (is_object($gEnv['hui']['theme']['handler'])) {
                    $die_image = $gEnv['hui']['theme']['handler']->mStyle['bigdot'];
                } else {
                    $die_image = '';
                }
                ?>
 
                                                <html>
                                                <head>
                                                <basefont face="Verdana">
                                                <title>Ampoliros</title>
                                                <link rel="stylesheet" type="text/css" href="<?php 
                echo $gEnv['hui']['theme']['handler']->mStyle['css'];
                ?>
">
                                                </head>
                                                
                                                <body bgcolor="white">
                                                
                                                <table border="0" cellspacing="0" cellpadding="0" align="center" width="200">
                                                <tr>
                                                    <td align="center"><a href="<?php 
                echo AMP_URL;
                ?>
"><img src="<?php 
                echo $die_image;
                ?>
" alt="Ampoliros" border="0"></a></td>
                                                </tr>
                                                <tr>
                                                <td>&nbsp; </td>
                                                </tr>
                                                <tr>
                                                <td align="center"><?php 
                echo $text;
                ?>
</td>
                                                </tr>
                                                </table>
                                                
                                                </body>
                                                </html>
                                                <?php 
                break;
        }
        $carthag = Carthag::instance();
        $carthag->halt();
    }
function main_moduleversions($eventData)
{
    global $gEnv, $gLocale, $gXml_def, $gPage_title, $gToolbars;
    OpenLibrary('modules.library');
    $ac_remote = new AmpCentralRemoteServer($gEnv['root']['db'], $eventData['id']);
    $avail_reps = $ac_remote->ListAvailableRepositories(isset($eventData['refresh']) ? true : false);
    $avail_mods = $ac_remote->ListAvailableModules($eventData['repid'], isset($eventData['refresh']) ? true : false);
    $mod_versions = $ac_remote->ListAvailableModuleVersions($eventData['repid'], $eventData['moduleid'], isset($eventData['refresh']) ? true : false);
    $x_account = new XmlRpcAccount($gEnv['root']['db'], $ac_remote->mAccountId);
    $headers[0]['label'] = $gLocale->GetStr('version.header');
    $headers[1]['label'] = $gLocale->GetStr('dependencies.header');
    $headers[2]['label'] = $gLocale->GetStr('installed_version.header');
    $gXml_def = '<vertgroup><name>modules</name>
  <children>
    <label><name>title</name>
      <args>
        <bold>true</bold>
        <label type="encoded">' . urlencode($x_account->mName . ' - ' . $avail_reps[$eventData['repid']]['name'] . ' - ' . $avail_mods[$eventData['moduleid']]['modid']) . '</label>
      </args>
    </label>
    <table><name>modules</name>
      <args>
        <headers type="array">' . huixml_encode($headers) . '</headers>
        <rowsperpage>10</rowsperpage>
        <pagesactionfunction>repmodules_list_action_builder</pagesactionfunction>
        <pagenumber>' . (isset($eventData['pagenumber']) ? $eventData['pagenumber'] : '') . '</pagenumber>
        <sessionobjectusername>' . $eventData['id'] . '-' . $eventData['repid'] . '-' . $eventData['moduleid'] . '</sessionobjectusername>
      </args>
      <children>';
    $row = 0;
    $mod_query =& $gEnv['root']['db']->Execute('SELECT modversion ' . 'FROM modules ' . 'WHERE modid=' . $gEnv['root']['db']->Format_Text($avail_mods[$eventData['moduleid']]['modid']));
    while (list($version, $data) = each($mod_versions)) {
        if (strlen($data['dependencies'])) {
            $mod_deps = new ModuleDep($gEnv['root']['db']);
            $dep_check = $mod_deps->CheckModuleDeps(0, '', $mod_deps->ExplodeDeps($data['dependencies']));
        } else {
            $dep_check = false;
        }
        if ($mod_query->NumRows()) {
            $current_version = $mod_query->Fields('modversion');
        } else {
            $current_version = $gLocale->GetStr('none_version.label');
        }
        if ($dep_check == false) {
            $mod_installable = true;
            $missing_deps = '';
            if ($mod_query->NumRows()) {
                switch (CompareVersionNumbers($version, $current_version)) {
                    case AMPOLIROS_VERSIONCOMPARE_EQUAL:
                        $label = $gLocale->GetStr('reinstall_module.button');
                        $icon = 'reload';
                        break;
                    case AMPOLIROS_VERSIONCOMPARE_MORE:
                        $label = $gLocale->GetStr('update_module.button');
                        $icon = 'folder_new';
                        break;
                    case AMPOLIROS_VERSIONCOMPARE_LESS:
                        $label = $gLocale->GetStr('downgrade_module.button');
                        $icon = 'down';
                        break;
                }
            } else {
                $label = $gLocale->GetStr('install_module.button');
                $icon = 'folder';
            }
        } else {
            $mod_installable = false;
            $missing_deps = '<br><strong>' . $gLocale->GetStr('missing_deps.label') . '</strong>';
            while (list(, $dep) = each($dep_check)) {
                $missing_deps .= '<br>' . $dep;
            }
        }
        $toolbars = array();
        if ($mod_installable) {
            $toolbars['main']['install'] = array('label' => $label, 'themeimage' => $icon, 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'repositorymodules', array('id' => $eventData['id'], 'repid' => $eventData['repid'])), array('action', 'installmodule', array('id' => $eventData['id'], 'repid' => $eventData['repid'], 'moduleid' => $eventData['moduleid'], 'version' => $version)))));
        }
        $gXml_def .= '<label row="' . $row . '" col="0"><name>version</name>
  <args>
    <label type="encoded">' . urlencode($version) . '</label>
  </args>
</label>

<label row="' . $row . '" col="1"><name>dependencies</name>
  <args>
    <label type="encoded">' . urlencode(str_replace(',', '<br>', $data['dependencies']) . (strlen($data['suggestions']) ? '<br><br><strong>' . $gLocale->GetStr('suggestions.label') . '</strong><br>' . str_replace(',', '<br>', $data['suggestions']) . '<br>' : '') . $missing_deps) . '</label>
  </args>
</label>

<label row="' . $row . '" col="2"><name>current</name>
  <args>
    <label type="encoded">' . urlencode($current_version) . '</label>
  </args>
</label>

<amptoolbar row="' . $row . '" col="3"><name>tb</name>
  <args>
    <frame>false</frame>
    <toolbars type="array">' . huixml_encode($toolbars) . '</toolbars>
  </args>
</amptoolbar>';
        $row++;
    }
    $gXml_def .= '      </children>
    </table>
  </children>
</vertgroup>';
    $gToolbars['reptools'] = array('refresh' => array('label' => $gLocale->GetStr('refresh.button'), 'themeimage' => 'reload', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'moduleversions', array('id' => $eventData['id'], 'repid' => $eventData['repid'], 'moduleid' => $eventData['moduleid'], 'refresh' => '1'))))));
    $gPage_title .= ' - ' . $gLocale->GetStr('moduleversions.title');
}
Beispiel #8
0
 public function openCatalog()
 {
     $result = false;
     import('carthag.core.Registry');
     $reg = Registry::instance();
     if ($this->catalog != null and $this->lang != null) {
         // Tries specified language catalog
         //
         if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_' . $this->lang . '.catalog')) {
             $catfile = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_' . $this->lang . '.catalog';
         } else {
             if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . '/var/locale/' . $this->catalog . '.catalog')) {
                 $catfile = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '.catalog';
             } else {
                 if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_' . AMP_LANG . '.catalog')) {
                     $catfile = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_' . AMP_LANG . '.catalog';
                 } else {
                     if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_en.catalog')) {
                         $catfile = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_en.catalog';
                     } else {
                         import('com.solarix.ampoliros.io.log.Logger');
                         $log = new Logger(AMP_LOG);
                         $log->LogEvent('ampoliros.locale_library.locale_class.opencatalog', 'Unable to find a catalog file for the specified catalog (' . $this->catalog . ') and language (' . $this->lang . ') or fallback to another language', LOGGER_ERROR);
                     }
                 }
             }
         }
         if (!empty($catfile)) {
             // New way to read locale catalogs
             //
             OpenLibrary('configman.library');
             $loc = new configfile($catfile);
             $this->locales = $loc->valuesarray();
             $result = true;
             /*
             if ( sizeof( $this->locales ) == 0 )
             {
                 if ( $fh = @fopen( $catfile, 'r' ) )
                 {
                     fclose( $fh );
             
                     include( $catfile );
                     $this->catversion = $catversion;
                     $this->catdate    = $catdate;
                     $this->locales    = $locale;
                 }
             }
             */
         }
     }
     return $result;
 }
Beispiel #9
0
 function CallHooks($event, &$obj, $args = '')
 {
     $result = false;
     if ($this->mAmpDb) {
         $query = $this->mAmpDb->Execute('SELECT * FROM hooks WHERE functionmodule=' . $this->mAmpDb->Format_Text($this->mModule) . ' AND function=' . $this->mAmpDb->Format_Text($this->mFunction) . ' AND event=' . $this->mAmpDb->Format_Text($event));
         if ($query) {
             global $gEnv;
             $result = HOOK_RESULT_OK;
             import('com.solarix.ampoliros.core.Ampoliros');
             $amp = Ampoliros::instance('Ampoliros');
             while (!$query->eof) {
                 $data = $query->Fields();
                 if ($amp->getState() == Ampoliros::STATE_DEBUG) {
                     $gEnv['runtime']['debug']['hooks'][$this->mModule . '::' . $this->mFunction . '::' . $event][] = $data['hookhandler'] . ' - ' . $data['hookfunction'];
                 }
                 OpenLibrary($data['hookhandler'], HANDLER_PATH);
                 $func_result = $data['hookfunction']($obj, $args);
                 if ($func_result == HOOK_RESULT_ABORT) {
                     $result = HOOK_RESULT_ABORT;
                 }
                 $query->MoveNext();
             }
         }
     }
     return $result;
 }
Beispiel #10
0
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: locale.php,v 1.19 2004-07-08 15:04:25 alex Exp $
require './auth.php';
Carthag::import('com.solarix.ampoliros.io.log.Logger');
Carthag::import('com.solarix.ampoliros.locale.Locale');
Carthag::import('com.solarix.ampoliros.locale.LocaleCountry');
OpenLibrary('sites.library');
OpenLibrary('misc.library');
OpenLibrary('hui.library');
$amp_locale = new Locale('amp_root_locale', $gEnv['user']['locale']['language']);
$amp_log = new Logger(AMP_LOG);
$hui = new Hui($env['ampdb']);
$hui->LoadWidget('button');
$hui->LoadWidget('checkbox');
$hui->LoadWidget('combobox');
$hui->LoadWidget('date');
$hui->LoadWidget('empty');
$hui->LoadWidget('file');
$hui->LoadWidget('formarg');
$hui->LoadWidget('form');
$hui->LoadWidget('grid');
$hui->LoadWidget('helpnode');
$hui->LoadWidget('horizbar');
$hui->LoadWidget('horizframe');
Beispiel #11
0
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: SecurityLayer.php,v 1.8 2004-07-14 13:15:37 alex Exp $
package('com.solarix.ampoliros.security');
import('carthag.core.Registry');
define('AMPOLIROS_SECURITY_PRESET_LOW', 1);
define('AMPOLIROS_SECURITY_PRESET_NORMAL', 2);
define('AMPOLIROS_SECURITY_PRESET_HIGH', 3);
define('AMPOLIROS_SECURITY_PRESET_PARANOID', 4);
OpenLibrary('configman.library');
class SecurityLayer extends Object
{
    public $mAlertsEmail;
    public $mReportsEmail;
    public $mSecurityLog;
    public $mAccessLog;
    /*!
    	@function SecurityLayer
    	@abstract Class constructor.
    	*/
    public function SecurityLayer()
    {
        $reg = Registry::instance();
        $this->mSecurityLog = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/log/security.log';
        $this->mAccessLog = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/log/access.log';
Beispiel #12
0
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: xmlrpc.php,v 1.11 2004-07-08 15:04:26 alex Exp $
require 'ampremote.php';
$amp = Ampoliros::instance('Ampoliros');
$amp->setInterface(Ampoliros::INTERFACE_REMOTE);
import('com.solarix.ampoliros.db.DBLayer');
$structure = array();
while (list(, $tmpdata) = each($gEnv['remote']['methods'])) {
    if ($tmpdata['handler'] and $tmpdata['name'] and $tmpdata['function']) {
        if (!defined(strtoupper($tmpdata['handler']) . '_XMLRPCMETHOD')) {
            OpenLibrary($tmpdata['handler'] . '.xmlrpchandler', HANDLER_PATH);
        }
        $structure[$tmpdata['name']]['function'] = $tmpdata['function'];
        if (isset($tmpdata['signature'])) {
            $structure[$tmpdata['name']]['signature'] = $tmpdata['signature'];
        }
        if (isset($tmpdata['docstring'])) {
            $structure[$tmpdata['name']]['docstring'] = $tmpdata['docstring'];
        }
    }
}
$xs = new XmlRpc_Server($structure);
Beispiel #13
0
 public function disableAllModules($ampolirosToo = true)
 {
     $result = false;
     if ($this->ampdb) {
         // Checks the enabled modules
         //
         $modsquery =& $this->ampdb->Execute('SELECT id ' . 'FROM activemodules,modules ' . 'WHERE activemodules.siteid=' . (int) $this->siteserial . ' ' . 'AND activemodules.moduleid=modules.id');
         $modules = array();
         while (!$modsquery->eof) {
             $modules[$modsquery->Fields('id')] = $modsquery->Fields('id');
             $modsquery->MoveNext();
         }
         $nummodules = $modsquery->NumRows();
         $ampquery = $this->ampdb->Execute('SELECT id ' . 'FROM modules ' . 'WHERE modid=' . $this->ampdb->Format_Text('ampoliros'));
         if (!$ampolirosToo) {
             unset($modules[$ampquery->Fields('id')]);
             $nummodules--;
         }
         // Tries to disable every module since all modules are disabled, following dependencies
         //
         while (count($modules) > 0) {
             $modid = current($modules);
             if (count($modules) == 1 and $modid == $ampquery->Fields('id') or count($modules) > 1 and $modid != $ampquery->Fields('id') or !$ampolirosToo) {
                 OpenLibrary('modulesbase.library');
                 $tmpmod = new Module($this->ampdb, $modid);
                 if ($tmpmod->Disable($this->siteserial)) {
                     import('com.solarix.ampoliros.io.log.Logger');
                     $log = new Logger(AMP_LOG);
                     $log->LogEvent($this->siteid, 'Disabled module ' . $tmpmod->modname, LOGGER_NOTICE);
                     $this->sitelog->LogEvent($this->siteid, 'Disabled module ' . $tmpmod->modname, LOGGER_NOTICE);
                     unset($modules[$modid]);
                 }
             }
             if (!next($modules)) {
                 reset($modules);
             }
         }
         $result = true;
     }
     return $result;
 }
Beispiel #14
0
        </button>

      </children>
    </horizgroup>

  </children>
</vertgroup>';
}
$gMain_disp->Dispatch();
$gHui->AddChild(new HuiAmpPage('page', array('pagetitle' => 'phplot test', 'maincontent' => new HuiXml('page', array('definition' => $gXml_def)), 'icon' => 'txt')));
$gHui->Render();
// --------------
exit;
//require( 'amproot.php' );
//init_amp_root();
OpenLibrary('phplot.library');
//Define the Object
$graph = new PHPlot(500, 300);
//Define some data
//include("./regression_data.php");
$example_data = array(array("A", 0.0, 20, 4, 5, 6), array("B", 2.0, 30, 5, 6, 7), array("C", 3.0, 40, 5, 7, 8), array("D", 4.0, 50, 3, 6, 3), array("E", 4.4, 40, 3, 6, 5), array("F", 5.4, 40, 5, 6, 5), array("G", 5.5, 40, 7, 6, 5), array("H", 7, 35, 0.0, 0.0, ""), array("I", 7.4, 40, 14, 16, 25), array("J", 7.6, 40, 6, 6, 5), array("K", 8.199999999999999, 40, 3, 6, 5), array("L", 8.5, 40, 8, 6, 9), array("M", 9.300000000000001, 40, 5, 6, 5), array("N", 9.6, 40, 9, 6, 7), array("O", 9.9, 40, 2, 6, 5), array("P", 10.0, 40, 3, 6, 8), array("Q", 10.4, 40, 3, 6, 5), array("R", 10.5, 40, 3, 6, 5), array("S", 10.8, 40, 3, 6, 5), array("T", 11.4, 40, 3, 6, 5), array("U", 12.0, 40, 3, 7, 5), array("V", 13.4, 40, 3, 5, 3), array("W", 14.0, 30, 3, 5, 6));
//$graph->SetXGridLabelType("time");
//Set the data type
//$graph->SetDataType("linear-linear");
//$graph->SetPointShape("halfline");
//Remove the X data labels
//$graph->SetXGridLabelType("none");
//Load the data into data array
$graph->SetDataValues($example_data);
$graph->SetDataColors(array("blue", 'white'), array("black"));
$graph->SetLineWidth("1");
Beispiel #15
0
function main_ampoliros($eventData)
{
    global $gEnv, $gXml_def, $gLocale, $gPage_title;
    OpenLibrary('ampoliros_cache.maintenance', HANDLER_PATH);
    OpenLibrary('ampoliros_logs.maintenance', HANDLER_PATH);
    $country = new LocaleCountry($GLOBALS['gEnv']['root']['locale']['country']);
    $tabs[0]['label'] = $gLocale->GetStr('ampoliros_status.tab');
    $tabs[1]['label'] = $gLocale->GetStr('ampoliros_settings.tab');
    $logs_main = new AmpolirosLogsMaintenance();
    $cache_main = new AmpolirosCacheMaintenance();
    $gXml_def = '<tab><name>ampoliros</name>
      <args>
        <tabs type="array">' . huixml_encode($tabs) . '</tabs>
        <tabactionfunction>ampoliros_tab_builder</tabactionfunction>
        <activetab>' . (isset($eventData['tab']) ? $eventData['tab'] : '') . '</activetab>
      </args>
      <children>
    
        <vertgroup><name></name>
          <children>
    
            <label><name>tabtitle</name>
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('ampoliros_status.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
        <grid>
          <children>
    
            <label row="0" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('systemlogs_size.label')) . '</label>
              </args>
            </label>
    
            <string row="0" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetSystemLogsSize())) . '</value>
              </args>
            </string>
    
            <button row="0" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_systemlogs')))) . '</action>
              </args>
            </button>
    
            <label row="1" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('siteslogs_size.label')) . '</label>
              </args>
            </label>
    
            <string row="1" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetSitesLogsSize())) . '</value>
              </args>
            </string>
    
            <button row="1" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_siteslogs')))) . '</action>
              </args>
            </button>
    
            <label row="2" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('cache_size.label')) . '</label>
              </args>
            </label>
    
            <string row="2" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetCacheSize())) . '</value>
              </args>
            </string>
    
            <button row="2" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_cache')))) . '</action>
              </args>
            </button>
    
            <label row="3" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('sessions_size.label')) . '</label>
              </args>
            </label>
    
            <string row="3" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetSessionsSize())) . '</value>
              </args>
            </string>
    
            <button row="3" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_sessions')))) . '</action>
              </args>
            </button>
    
            <label row="4" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('pidfiles_size.label')) . '</label>
              </args>
            </label>
    
            <string row="4" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetPidFilesSize())) . '</value>
              </args>
            </string>
    
            <button row="4" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_pidfiles')))) . '</action>
              </args>
            </button>
    
            <label row="5" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('tempdirs_size.label')) . '</label>
              </args>
            </label>
    
            <string row="5" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetAmpTempDirsSize())) . '</value>
              </args>
            </string>
    
            <button row="5" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_tempdirs')))) . '</action>
              </args>
            </button>
    
            <label row="6" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('clipboard_size.label')) . '</label>
              </args>
            </label>
    
            <string row="6" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetClipboardSize())) . '</value>
              </args>
            </string>
    
            <button row="6" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_clipboard')))) . '</action>
              </args>
            </button>
    
            <label row="7" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('cleanable_size.label')) . '</label>
              </args>
            </label>
    
            <string row="7" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetCleanableDiskSize() + $cache_main->GetCleanableDiskSize())) . '</value>
              </args>
            </string>
    
            <button row="7" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clearall.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_all')))) . '</action>
              </args>
            </button>
    
          </children>
        </grid>
    
          </children>
        </vertgroup>
    
        <vertgroup><name></name>
          <children>
    
            <label><name>tabtitle</name>
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('ampoliros_settings.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
            <form><name>settings</name>
              <args>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'set_ampoliros')))) . '</action>          </args>
              <children>
        <vertgroup>
          <children>
        <grid>
          <children>
    
            <label row="0" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('action_clean.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
            <label row="0" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('action_rotate.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
            <label row="0" col="2">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('action_none.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
            <radio row="1" col="0" halign="center"><name>amplog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanAmpLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="1" col="1" halign="center"><name>amplog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateAmpLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="1" col="2" halign="center"><name>amplog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanAmpLog() or $logs_main->GetRotateAmpLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="1" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('amplog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="2" col="0" halign="center"><name>ampdblog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanAmpDbLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="2" col="1" halign="center"><name>ampdblog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateAmpDbLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="2" col="2" halign="center"><name>ampdblog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanAmpDbLog() or $logs_main->GetRotateAmpDbLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="2" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('ampdblog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="3" col="0" halign="center"><name>accesslog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanAccessLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="3" col="1" halign="center"><name>accesslog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateAccessLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="3" col="2" halign="center"><name>accesslog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanAccessLog() or $logs_main->GetRotateAccessLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="3" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('accesslog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="4" col="0" halign="center"><name>remotelog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanRemoteLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="4" col="1" halign="center"><name>remotelog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateRemoteLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="4" col="2" halign="center"><name>remotelog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanRemoteLog() or $logs_main->GetRotateRemoteLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="4" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('remotelog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="5" col="0" halign="center"><name>phplog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanPhpLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="5" col="1" halign="center"><name>phplog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotatePhpLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="5" col="2" halign="center"><name>phplog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanPhpLog() or $logs_main->GetRotatePhpLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="5" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('phplog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="6" col="0" halign="center"><name>siteslogs</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanSitesLogs() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="6" col="1" halign="center"><name>siteslogs</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateSitesLogs() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="6" col="2" halign="center"><name>siteslogs</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanSitesLogs() or $logs_main->GetRotateSitesLogs()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="6" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('siteslogs_size.label')) . '</label>
              </args>
            </label>
    
          </children>
        </grid>
    
        <horizbar/>
    
        <grid>
          <children>
            <checkbox row="0" col="0"><name>cache</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanCache() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="0" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('cache_size.label')) . '</label>
              </args>
            </label>
    
            <checkbox row="1" col="0"><name>sessions</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanSessions() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="1" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('sessions_size.label')) . '</label>
              </args>
            </label>
    
            <checkbox row="2" col="0"><name>pidfiles</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanPidFiles() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="2" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('pidfiles_size.label')) . '</label>
              </args>
            </label>
    
            <checkbox row="3" col="0"><name>amptempdirs</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanAmpTempDirs() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="3" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('tempdirs_size.label')) . '</label>
              </args>
            </label>
    
            <checkbox row="4" col="0"><name>clipboard</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanClipboard() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="4" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('clipboard_size.label')) . '</label>
              </args>
            </label>
    
          </children>
        </grid>
    
          </children>
        </vertgroup>
    
              </children>
            </form>
    
            <horizbar/>
    
            <button>
              <args>
                <themeimage>button_ok</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('apply.button')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <formsubmit>settings</formsubmit>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'set_ampoliros')))) . '</action>
              </args>
            </button>
    
          </children>
        </vertgroup>
    
      </children>
    </tab>';
    $gPage_title .= ' - ' . $gLocale->GetStr('ampoliros.title');
}
Beispiel #16
0
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: ampinterface.php,v 1.20 2004-07-08 15:04:25 alex Exp $
require './auth.php';
import('com.solarix.ampoliros.io.log.Logger');
import('com.solarix.ampoliros.locale.Locale');
import('com.solarix.ampoliros.site.SiteSettings');
OpenLibrary('misc.library');
OpenLibrary('hui.library');
OpenLibrary('modules.library');
$amp_locale = new Locale('amp_site_interface', $gEnv['user']['locale']['language']);
$amp_log = new Logger(AMP_LOG);
$hui = new Hui($env['ampdb']);
$hui->LoadWidget('button');
$hui->LoadWidget('checkbox');
$hui->LoadWidget('combobox');
$hui->LoadWidget('date');
$hui->LoadWidget('empty');
$hui->LoadWidget('file');
$hui->LoadWidget('formarg');
$hui->LoadWidget('form');
$hui->LoadWidget('grid');
$hui->LoadWidget('helpnode');
$hui->LoadWidget('horizbar');
$hui->LoadWidget('horizframe');
 function DoMaintenance()
 {
     $result = array();
     $tasks_query =& $GLOBALS['gEnv']['root']['db']->Execute('SELECT * FROM maintenancetasks ' . 'WHERE enabled=' . $GLOBALS['gEnv']['root']['db']->Format_Text($GLOBALS['gEnv']['root']['db']->fmttrue));
     while (!$tasks_query->eof) {
         if (OpenLibrary($tasks_query->Fields('file'), HANDLER_PATH)) {
             $function = $tasks_query->Fields('name') . '_maintenance_handler';
             $result[$tasks_query->Fields('name')] = $function();
         }
         $tasks_query->MoveNext();
     }
     $tasks_query->Free();
     $cfg = new ConfigFile(AMP_CONFIG);
     $cfg->SetValue('LAST_MAINTENANCE', time());
     return $result;
 }
Beispiel #18
0
 public function removeUser()
 {
     import('com.solarix.ampoliros.util.Hook');
     $hook = new Hook($this->mrAmpDb, 'ampoliros', 'site.user.remove');
     if ($hook->CallHooks('calltime', $this, array('siteserial' => $this->siteserial, 'userid' => $this->userid)) == HOOK_RESULT_OK) {
         if ($this->userid != 0) {
             $result = $this->mrAmpDb->Execute('DELETE FROM users ' . 'WHERE siteid=' . (int) $this->siteserial . ' ' . 'AND id=' . (int) $this->userid);
             // Remove user dir
             $site_query =& $GLOBALS['gEnv']['root']['db']->Execute('SELECT siteid ' . 'FROM sites ' . 'WHERE id=' . (int) $this->siteserial);
             OpenLibrary('misc.library');
             if (SITESTUFF_PATH . $site_query->Fields('siteid') . '/users/' . $this->username != SITESTUFF_PATH . $site_query->Fields('siteid') . '/users/') {
                 RecRemoveDir(SITESTUFF_PATH . $site_query->Fields('siteid') . '/users/' . $this->username, 0755);
             }
             // Remove cached items
             Carthag::import('com.solarix.ampoliros.datatransfer.cache.CacheGarbageCollector');
             $cache_gc = new CacheGarbageCollector();
             $cache_gc->RemoveUserItems((int) $this->userid);
             //$this->htp->remuser( $this->username );
             if ($hook->CallHooks('userremoved', $this, array('siteserial' => $this->siteserial, 'userid' => $this->userid)) != HOOK_RESULT_OK) {
                 $result = false;
             }
             $this->userid = 0;
         }
     }
     return $result;
 }
Beispiel #19
0
 public function submitBugReport($moddata, $from, $message = '', $notifyAmpolirosTeam = false)
 {
     if (is_array($moddata) and isset($moddata['email']) and strlen($from)) {
         OpenLibrary('mail.library');
         $bug_report = new Mail();
         $bug_report->From($from);
         $bug_report->ReplyTo($from);
         $bug_report->To($moddata['email']);
         $bug_report->Subject('Ampoliros bug report for ' . (strlen($moddata['module']) ? '"' . $moddata['module'] . '[' . $moddata['version'] . ']"' : 'undefined') . ' module');
         $bug_report->Body('Ampoliros bug report for ' . (strlen($moddata['module']) ? '"' . $moddata['module'] . '[' . $moddata['version'] . ']"' : 'undefined') . ' module' . "\n\n" . (strlen($message) ? 'Message from bug report submitter:' . "\n\n" . $message . "\n\n" : "\n\n"));
         if ($notifyAmpolirosTeam and $moddata['email'] != $moddata['ampolirosemail']) {
             $bug_report->Cc($moddata['ampolirosemail']);
         }
         $bug_report->Attach(TMP_PATH . 'pids/' . $this->mPid, 'text/plain', 'attachment');
         $bug_report->Send();
         return true;
     }
     return false;
 }
Beispiel #20
0
 public function getColorsSet()
 {
     $result = array();
     OpenLibrary('configman.library');
     $cfg_file = new ConfigFile(CONFIG_PATH . $this->mSetName . '.huicolorsset');
     if ($cfg_file->Opened()) {
         $result['pages']['bgcolor'] = $cfg_file->Value('COLORSET.PAGES.BGCOLOR');
         $result['pages']['border'] = $cfg_file->Value('COLORSET.PAGES.BORDER');
         $result['buttons']['text'] = $cfg_file->Value('COLORSET.BUTTONS.TEXT');
         $result['buttons']['disabledtext'] = $cfg_file->Value('COLORSET.BUTTONS.DISABLEDTEXT');
         $result['buttons']['selected'] = $cfg_file->Value('COLORSET.BUTTONS.SELECTED');
         $result['buttons']['notselected'] = $cfg_file->Value('COLORSET.BUTTONS.NOTSELECTED');
         $result['bars']['color'] = $cfg_file->Value('COLORSET.BARS.COLOR');
         $result['bars']['shadow'] = $cfg_file->Value('COLORSET.BARS.SHADOW');
         $result['frames']['border'] = $cfg_file->Value('COLORSET.FRAMES.BORDER');
         $result['statusbars']['bgcolor'] = $cfg_file->Value('COLORSET.STATUSBARS.BGCOLOR');
         $result['titlebars']['bgcolor'] = $cfg_file->Value('COLORSET.TITLEBARS.BGCOLOR');
         $result['titlebars']['textcolor'] = $cfg_file->Value('COLORSET.TITLEBARS.TEXTCOLOR');
         $result['toolbars']['separator'] = $cfg_file->Value('COLORSET.TOOLBARS.SEPARATOR');
         $result['tables']['bgcolor'] = $cfg_file->Value('COLORSET.TABLES.BGCOLOR');
         $result['tables']['headerbgcolor'] = $cfg_file->Value('COLORSET.TABLES.HEADERBGCOLOR');
         $result['tables']['gridcolor'] = $cfg_file->Value('COLORSET.TABLES.GRIDCOLOR');
     } else {
         import('com.solarix.ampoliros.io.log.Logger');
         $log = new Logger(AMP_LOG);
         $log->LogEvent('ampoliros.huithemes_library.huicolorsset_class.getcolorsset', 'Unable to open colors set file ' . CONFIG_PATH . $this->mSetName . '.huicolorsset', LOGGER_ERROR);
     }
     return $result;
 }
Beispiel #21
0
 function HandleStructure($deffilepath, $installmode, $tmpdir, $siteid = 0, $setup = FALSE)
 {
     $result = FALSE;
     $this->onlyextension = TRUE;
     // Installation mode depending variables initializazion
     //
     switch ($installmode) {
         case Module::INSTALL_MODE_INSTALL:
             $sortmode = 'cmp';
             $scriptdir = $tmpdir . '/defs/';
             $prescript = 'generalpreinstall';
             $postscript = 'generalpostinstall';
             break;
         case Module::INSTALL_MODE_UNINSTALL:
             $sortmode = 'rcmp';
             $scriptdir = $tmpdir . '/defs/';
             $prescript = 'generalpreuninstall';
             $postscript = 'generalpostuninstall';
             break;
         case Module::INSTALL_MODE_UPDATE:
             $sortmode = 'cmp';
             $scriptdir = $tmpdir . '/defs/';
             $prescript = 'generalpreupdate';
             $postscript = 'generalpostupdate';
             $siteprescript = $sitepostscript = '';
             break;
         case Module::INSTALL_MODE_ENABLE:
             $sortmode = 'cmp';
             $scriptdir = $tmpdir . '/';
             $prescript = 'sitepreinstall';
             $postscript = 'sitepostinstall';
             break;
         case Module::INSTALL_MODE_DISABLE:
             $sortmode = 'rcmp';
             $scriptdir = $tmpdir . '/';
             $prescript = 'sitepreuninstall';
             $postscript = 'sitepostuninstall';
             break;
         default:
             break;
     }
     // Parse structure file
     //
     switch ($installmode) {
         case Module::INSTALL_MODE_UPDATE:
             $structure = $this->MergeStructureFiles($deffilepath, MODULE_PATH . $this->modname . '/' . Module::STRUCTURE_FILE, $tmpdir);
             break;
         default:
             $deffile = new XMLDefFile($this->ampdb, $tmpdir);
             $deffile->Load_DefFile($deffilepath);
             $structure = $deffile->Get_Structure();
     }
     // Sort structure elements by priority
     //
     uksort($structure, array($this, $sortmode));
     // Check for site update scripts
     if (isset($structure['sitepreupdate'])) {
         $siteprescript = $scriptdir . $structure['sitepreupdate'];
     }
     if (isset($structure['sitepostupdate'])) {
         $sitepostscript = $scriptdir . $structure['sitepostupdate'];
     }
     // Check for preinstallation jobs
     //
     if (isset($structure[$prescript]) and sizeof($structure[$prescript])) {
         include $scriptdir . $structure[$prescript];
     }
     // Install elements
     //
     while (list($eltype, $arraycontent) = each($structure)) {
         // Checks if it is an element and skips scripts
         //
         switch ($eltype) {
             case 'generalpreinstall':
             case 'generalpreuninstall':
             case 'generalpostinstall':
             case 'generalpostuninstall':
             case 'sitepreinstall':
             case 'sitepreuninstall':
             case 'sitepostinstall':
             case 'sitepostuninstall':
             case 'generalpreupdate':
             case 'generalpostupdate':
             case 'sitepreupdate':
             case 'sitepostupdate':
                 break;
             default:
                 // Checks if the element type file exists
                 //
                 if (file_exists(HANDLER_PATH . strtolower($eltype) . '.element')) {
                     while (list(, $val) = each($arraycontent)) {
                         // If the element type file was not already included, include it
                         //
                         OpenLibrary(strtolower($eltype) . '.element', HANDLER_PATH);
                         // Checks for file and name element attributes
                         //
                         if (empty($val['file'])) {
                             $val['file'] = $val['name'];
                             //$this->mLog->LogEvent( 'ampoliros.modules_library.modules_class.handlestructure',
                             //                      'An element of '.$eltype.' type in '.$this->modname.' module has no file property', LOGGER_WARNING );
                         }
                         if (empty($val['name'])) {
                             $val['name'] = $val['file'];
                             // Should never happen
                             //$this->mLog->LogEvent( 'ampoliros.modules_library.modules_class.handlestructure',
                             //                      'An element of '.$eltype.' type in '.$this->modname.' module has no name property', LOGGER_WARNING );
                         }
                         // Creates a new instance of the element type class and installs the element
                         //
                         $tmpclassname = $this->eltypes->types[$eltype]['classname'];
                         //if ( !$tmpclassname ) $tmpclassname = $eltype;
                         if ($tmpclassname) {
                             $tmpelement = new $tmpclassname($this->ampdb, $this->sitedb, $this->modname, $val['name'], $val['file'], $tmpdir);
                             /*
                             {
                             unset( $element );
                             if ( file_exists( HANDLER_PATH.$data['file'] ) )
                             {
                             include( HANDLER_PATH.$data['file'] );
                             }
                             else $this->mLog->LogEvent( 'ampoliros.modules_library.moduleelementfactory_class.filltypes', 'Element file '.$data['file'].' doesn't exists in handlers directory', LOGGER_WARNING );
                                                             
                             $this->types[$element['type']] = $element;
                             }
                             */
                             if ($setup) {
                                 $tmpelement->setup = TRUE;
                             }
                             if ($tmpelement->site == true) {
                                 $this->onlyextension = FALSE;
                             }
                             // Calls appropriate method
                             //
                             switch ($installmode) {
                                 case Module::INSTALL_MODE_INSTALL:
                                     $tmpelement->Install($val);
                                     break;
                                 case Module::INSTALL_MODE_UNINSTALL:
                                     $tmpelement->UnInstall($val);
                                     break;
                                 case Module::INSTALL_MODE_UPDATE:
                                     $tmpelement->Update($val['updatemode'], $val, $siteprescript, $sitepostscript);
                                     break;
                                 case Module::INSTALL_MODE_ENABLE:
                                     $tmpelement->Enable($siteid, $val);
                                     break;
                                 case Module::INSTALL_MODE_DISABLE:
                                     $tmpelement->Disable($siteid, $val);
                                     break;
                                 default:
                                     import('com.solarix.ampoliros.io.log.Logger');
                                     $log = new Logger(AMP_LOG);
                                     $log->LogEvent('ampoliros.modules_library.modules_class.handlestructure', 'Invalid installation method for element of ' . $eltype . ' type in ' . $this->modname . ' module', LOGGER_ERROR);
                                     break;
                             }
                             // There may be changes in element types, so we refill eltypes array
                             //
                             if ($eltype == 'element') {
                                 $this->eltypes->FillTypes();
                             }
                             unset($tmpelement);
                         } else {
                             import('com.solarix.ampoliros.io.log.Logger');
                             $log = new Logger(AMP_LOG);
                             $log->LogEvent('ampoliros.modules_library.modules_class.handlestructure', 'Element class (' . $tmpclassname . ') for element ' . $eltype . ' in ' . $this->modname . " module doesn't exists", LOGGER_WARNING);
                         }
                     }
                 } else {
                     import('com.solarix.ampoliros.io.log.Logger');
                     $log = new Logger(AMP_LOG);
                     $log->LogEvent('ampoliros.modules_library.modules_class.handlestructure', 'Element handler for element ' . $eltype . ' in ' . $this->modname . " module doesn't exists", LOGGER_WARNING);
                 }
                 break;
         }
     }
     // Checks for postinstallation jobs
     //
     if (isset($structure[$postscript]) and sizeof($structure[$postscript])) {
         include $scriptdir . $structure[$postscript];
     }
     $result = TRUE;
     return $result;
 }
Beispiel #22
0
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: password.php,v 1.19 2004-07-08 15:04:25 alex Exp $
require './auth.php';
OpenLibrary('hui.library');
import('com.solarix.ampoliros.locale.Locale');
import('com.solarix.ampoliros.io.log.Logger');
OpenLibrary('users.library');
$log = new Logger(AMP_LOG);
$amp_locale = new Locale('amp_site_password', $gEnv['user']['locale']['language']);
$hui = new Hui($env['ampdb']);
$hui->LoadWidget('button');
$hui->LoadWidget('checkbox');
$hui->LoadWidget('combobox');
$hui->LoadWidget('date');
$hui->LoadWidget('empty');
$hui->LoadWidget('file');
$hui->LoadWidget('formarg');
$hui->LoadWidget('form');
$hui->LoadWidget('grid');
$hui->LoadWidget('helpnode');
$hui->LoadWidget('horizbar');
$hui->LoadWidget('horizframe');
Beispiel #23
0
 *
 *   Copyright (C) 2000-2004 Solarix
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: websetup.php,v 1.8 2004-07-08 15:04:25 alex Exp $
require './ampoliros.php';
OpenLibrary('setup.library');
ob_end_flush();
echo "\n\n                    Ampoliros Application Server\n\n                      http://www.ampoliros.com\n\n\n\n";
echo "Starting setup...\n";
if (setup_by_config_file('', TRUE)) {
    echo "Setup successfull\n";
    return 1;
} else {
    echo "ERROR. Setup unsuccessfull\n";
    return 0;
}
Beispiel #24
0
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: security.php,v 1.21 2004-07-14 13:15:37 alex Exp $
// ----- Initialization -----
//
require './auth.php';
import('com.solarix.ampoliros.locale.Locale');
import('com.solarix.ampoliros.hui.Hui');
import('com.solarix.ampoliros.hui.HuiEventsCall');
import('com.solarix.ampoliros.security.SecurityLayer');
OpenLibrary('ampshared.library');
$gLocale = new Locale('amp_root_security', $gEnv['root']['locale']['language']);
$gHui = new Hui($gEnv['root']['db']);
$gHui->LoadWidget('xml');
$gHui->LoadWidget('amppage');
$gHui->LoadWidget('amptoolbar');
$gXml_def = $gPage_status = '';
$gPage_title = $gLocale->GetStr('security.title');
$gToolbars['main'] = array('check' => array('label' => $gLocale->GetStr('check.toolbar'), 'themeimage' => 'viewmag', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'default', '')))), 'settings' => array('label' => $gLocale->GetStr('settings.toolbar'), 'themeimage' => 'configure', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'settings', '')))));
$gToolbars['help'] = array('help' => array('label' => $gLocale->GetStr('help.toolbar'), 'themeimage' => 'help', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'help', '')))));
// ----- Action dispatcher -----
//
$gAction_disp = new HuiDispatcher('action');
$gAction_disp->AddEvent('set_security_preset', 'action_set_security_preset');
function action_set_security_preset($eventData)
{
Beispiel #25
0
function main_situation($eventData)
{
    global $hui_mainframe, $amp_locale, $hui_titlebar;
    OpenLibrary('modules.library');
    $sites_query =& $GLOBALS['gEnv']['root']['db']->Execute('SELECT siteid ' . 'FROM sites ' . 'ORDER BY siteid');
    $modules_query =& $GLOBALS['gEnv']['root']['db']->Execute('SELECT modid ' . 'FROM modules ' . 'WHERE onlyextension=' . $GLOBALS['gEnv']['root']['db']->Format_Text($GLOBALS['gEnv']['root']['db']->fmtfalse) . ' ' . 'ORDER BY modid');
    $headers = array();
    $cont = 1;
    while (!$modules_query->eof) {
        $orig_label = $modules_query->Fields('modid');
        $label = '';
        for ($i = 0; $i < strlen($orig_label); $i++) {
            if ($i) {
                $label .= '<br>';
            }
            $label .= $orig_label[$i];
        }
        $headers[$cont++]['label'] = $label;
        $modules_query->MoveNext();
    }
    $xml_def = '<table><name>situation</name>
      <args>
        <headers type="array">' . huixml_encode($headers) . '</headers>
      </args>
      <children>';
    $row = 0;
    $mod_deps = new ModuleDep($GLOBALS['gEnv']['root']['db']);
    while (!$sites_query->eof) {
        $xml_def .= '<label row="' . $row . '" col="0">
          <args>
            <label type="encoded">' . urlencode($sites_query->Fields('siteid')) . '</label>
            <compact>true</compact>
          </args>
        </label>';
        $col = 1;
        $modules_query->MoveFirst();
        while (!$modules_query->eof) {
            $enabled = $mod_deps->IsEnabled($modules_query->Fields('modid'), $sites_query->Fields('siteid'));
            $xml_def .= '<image row="' . $row . '" col="' . $col . '" halign="center" valign="middle">
              <args>
                <imageurl>' . ($enabled ? $hui_mainframe->mThemeHandler->mStyle['greenball'] : $hui_mainframe->mThemeHandler->mStyle['redball']) . '</imageurl>
              </args>
            </image>';
            $col++;
            $modules_query->MoveNext();
        }
        $row++;
        $sites_query->MoveNext();
    }
    $xml_def .= '  </children>
    </table>';
    $hui_mainframe->AddChild(new HuiXml('', array(definition => $xml_def)));
}
 public function dBLayerFactory()
 {
     OpenLibrary('configman.library');
     $this->FillDbLayers();
 }
Beispiel #27
0
 public function open()
 {
     $result = false;
     import('carthag.core.Registry');
     $reg = Registry::instance();
     OpenLibrary('configman.library');
     $country_file = new ConfigFile($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->mCountry . '.country');
     if ($country_file->Opened()) {
         $this->mCountryShort = $country_file->Value('COUNTRYSHORT');
         $this->mLanguage = $country_file->Value('LANGUAGE');
         $this->mDecimalSeparator = $country_file->Value('DECIMALSEPARATOR');
         $this->mThousandsSeparator = $country_file->Value('THOUSANDSSEPARATOR');
         $this->mPositiveSign = $country_file->Value('POSITIVESIGN');
         $this->mNegativeSign = $country_file->Value('NEGATIVESIGN');
         $this->mCurrencySymbol = $country_file->Value('CURRENCYSYMBOL');
         $this->mMoneyDecimalSeparator = $country_file->Value('MONEYDECIMALSEPARATOR');
         $this->mMoneyThousandsSeparator = $country_file->Value('MONEYTHOUSANDSSEPARATOR');
         $this->mFractDigits = $country_file->Value('FRACTDIGITS');
         $this->mPositivePrefixCurrency = $country_file->Value('POSITIVEPREFIXCURRENCY');
         $this->mPositiveSignPosition = $country_file->Value('POSITIVESIGNPOSITION');
         $this->mNegativePrefixCurrency = $country_file->Value('NEGATIVEPREFIXCURRENCY');
         $this->mNegativeSignPosition = $country_file->Value('NEGATIVESIGNPOSITION');
         $this->mTimeFormat = $country_file->Value('TIMEFORMAT');
         $this->mDateFormat = $country_file->Value('DATEFORMAT');
         $this->mShortDateFormat = $country_file->Value('SHORTDATEFORMAT');
         $this->mStartWeekOnMonday = $country_file->Value('STARTWEEKONMONDAY');
         $this->mDateSeparator = $country_file->Value('DATESEPARATOR');
         $this->mDateOrder = $country_file->Value('DATEORDER');
         $this->mCharSet = $country_file->Value('CHARSET');
         $result = true;
     } else {
         import('com.solarix.ampoliros.io.log.Logger');
         $log = new Logger(AMP_LOG);
         $log->LogEvent('ampoliros.locale_library.country_class.open', 'Unable to open country file ' . $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->mCountry . '.country', LOGGER_ERROR);
     }
     return $result;
 }
Beispiel #28
0
<?php

// Initialization
//
require 'auth.php';
OpenLibrary('configman.library');
OpenLibrary('locale.library');
OpenLibrary('hui.library');
OpenLibrary('ampshared.library');
OpenLibrary('jpcache.library');
$gEnv['runtime']['modules']['jpcache']['cacheon'] = 0;
$gLocale = new Locale('jpcache_root_jpcache', $gEnv['root']['locale']['language']);
$gHui = new Hui($gEnv['root']['db']);
$gHui->LoadWidget('amppage');
$gHui->LoadWidget('amptoolbar');
$gHui->LoadWidget('xml');
$gPage_content = $gStatus = $gToolbars = '';
$gTitle = $gLocale->GetStr('jpcache.title');
$gMenu = get_ampoliros_root_menu_def($gEnv['root']['locale']['language']);
$gToolbars['main'] = array('main' => array('label' => $gLocale->GetStr('default.button'), 'themeimage' => 'configure', 'action' => build_events_call_string('', array(array('main', 'default', '')))), 'stats' => array('label' => $gLocale->GetStr('stats.button'), 'themeimage' => 'folder', 'action' => build_events_call_string('', array(array('main', 'stats', '')))), 'erase' => array('label' => $gLocale->GetStr('erasecache.button'), 'themeimage' => 'edittrash', 'action' => build_events_call_string('', array(array('main', 'default', ''), array('action', 'erasecache', ''))), 'needconfirm' => 'true', 'confirmmessage' => $gLocale->GetStr('erase.confirm')));
/*
$gToolbars['help'] = array( 'help' => array(
                                            'label' => $gLocale->GetStr( 'help.button' ),
                                            'themeimage' => 'help',
                                            'action' => build_events_call_string( '', array( array( 'main', 'help', '' ) ) )
                                           ) );
*/
// Action dispatcher
//
$gAction_disp = new HuiDispatcher('action');
$gAction_disp->AddEvent('setprefs', 'action_setprefs');
Beispiel #29
0
<?php

require 'auth.php';
OpenLibrary('hui.library');
OpenLibrary('modules.library');
OpenLibrary('locale.library');
$gYaps_locale = new Locale('yaps', AMP_LANG);
$gHui = new Hui($env['ampdb']);
$gHui->LoadWidget('amppage');
$gHui->LoadWidget('amptoolbar');
$gHui->LoadWidget('xml');
$gHui->LoadWidget('empty');
$gPage_content = $gStatus = $gMenu = $gToolbars = '';
$gTitle = $gYaps_locale->GetStr('yaps_title');
$action_disp = new HuiDispatcher('action');
$action_disp->AddEvent('setsettings', 'action_setsettings');
function action_setsettings($eventData)
{
    global $env, $gStatus, $gYaps_locale;
    $mod_settings = new ModuleConfig($env['ampdb'], 'yaps');
    $mod_settings->SetKey('gs_exec', $eventData['gsexec']);
    $gStatus = $gYaps_locale->GetStr('settingsset_status');
}
$action_disp->Dispatch();
$main_disp = new HuiDispatcher('main');
$main_disp->AddEvent('default', 'main_default');
function main_default($eventData)
{
    global $env, $gYaps_locale, $gTitle, $gPage_content;
    $mod_settings = new ModuleConfig($env['ampdb'], 'yaps');
    $gs_exec = $mod_settings->GetKey('gs_exec');