Esempio n. 1
0
function main_users($eventData)
{
    global $env, $amp_locale, $hui_mainframe, $hui_titlebar;
    $users_query =& $env['ampdb']->Execute('SELECT id,username,fname,lname,email,groupid ' . 'FROM users ' . 'WHERE siteid=' . $env['currentsiteserial'] . ' ' . 'ORDER BY username');
    $prof_query =& $env['db']->Execute('SELECT id,groupname ' . 'FROM groups ' . 'ORDER BY groupname');
    $profiles = array();
    while (!$prof_query->eof) {
        $prof_data = $prof_query->Fields();
        $profiles[$prof_data['id']] = $prof_data['groupname'];
        $prof_query->MoveNext();
    }
    if ($users_query->NumRows()) {
        $headers[0]['label'] = $amp_locale->GetStr('username_header');
        $headers[1]['label'] = $amp_locale->GetStr('completename_header');
        $headers[2]['label'] = $amp_locale->GetStr('email_header');
        $headers[3]['label'] = $amp_locale->GetStr('userprofilename_header');
        $row = 0;
        $hui_users_table = new HuiTable('userstable', array('headers' => $headers));
        while (!$users_query->eof) {
            $user_data = $users_query->Fields();
            $hui_users_table->AddChild(new HuiLabel('usernamelabel' . $row, array('label' => $user_data['username'])), $row, 0);
            $hui_users_table->AddChild(new HuiLabel('completenamelabel' . $row, array('label' => strcmp($user_data['username'], $env['currentsite']) != 0 ? $user_data['lname'] . ' ' . $user_data['fname'] : $amp_locale->GetStr('superuser_label'))), $row, 1);
            $hui_users_table->AddChild(new HuiLabel('emaillabel' . $row, array('label' => $user_data['email'])), $row, 2);
            $hui_users_table->AddChild(new HuiLabel('userprofilelabel' . $row, array('label' => ($user_data['groupid'] != '0' and strlen($user_data['groupid'])) ? $profiles[$user_data['groupid']] : $amp_locale->GetStr('noprofileid_label'))), $row, 3);
            if (strcmp($user_data['username'], $env['currentsite']) != 0) {
                $hui_user_toolbar[$row] = new HuiToolBar('usertoolbar' . $row);
                $profile_action[$row] = new HuiEventsCall();
                $profile_action[$row]->AddEvent(new HuiEvent('main', 'chprofile', array('userid' => $user_data['id'])));
                $hui_profile_button[$row] = new HuiButton('profilebutton' . $row, array('label' => $amp_locale->GetStr('chprofile_label'), 'themeimage' => 'view_tree', 'action' => $profile_action[$row]->GetEventsCallString()));
                $hui_user_toolbar[$row]->AddChild($hui_profile_button[$row]);
                $chpasswd_action[$row] = new HuiEventsCall();
                $chpasswd_action[$row]->AddEvent(new HuiEvent('main', 'chpassword', array('userid' => $user_data['id'])));
                $hui_chpasswd_button[$row] = new HuiButton('chpasswdbutton' . $row, array('label' => $amp_locale->GetStr('chpasswd_label'), 'themeimage' => 'edit', 'action' => $chpasswd_action[$row]->GetEventsCallString()));
                $hui_user_toolbar[$row]->AddChild($hui_chpasswd_button[$row]);
                $chdata_action[$row] = new HuiEventsCall();
                $chdata_action[$row]->AddEvent(new HuiEvent('main', 'edituser', array('userid' => $user_data['id'])));
                $hui_chdata_button[$row] = new HuiButton('chdatabutton' . $row, array('label' => $amp_locale->GetStr('chdata_label'), 'themeimage' => 'edit', 'action' => $chdata_action[$row]->GetEventsCallString()));
                $hui_user_toolbar[$row]->AddChild($hui_chdata_button[$row]);
                $remove_action[$row] = new HuiEventsCall();
                $remove_action[$row]->AddEvent(new HuiEvent('main', 'deleteuser', array('userid' => $user_data['id'])));
                $hui_remove_button[$row] = new HuiButton('removebutton' . $row, array('label' => $amp_locale->GetStr('removeuser_label'), 'themeimage' => 'edittrash', 'action' => $remove_action[$row]->GetEventsCallString()));
                $hui_user_toolbar[$row]->AddChild($hui_remove_button[$row]);
                $hui_users_table->AddChild($hui_user_toolbar[$row], $row, 4);
            }
            $users_query->MoveNext();
            $row++;
        }
        $hui_mainframe->AddChild($hui_users_table);
    }
    $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('users_title');
}
Esempio n. 2
0
function main_showmethods($eventData)
{
    global $env, $gEnv, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar;
    $acc_query =& $env['ampdb']->execute('SELECT name ' . 'FROM xmlrpcaccounts ' . 'WHERE id=' . $eventData['accountid']);
    $acc_data = $acc_query->Fields();
    $hui_vgroup = new HuiVertGroup('vgroup');
    $xmlrpc_account = new XmlRpcAccount($gEnv['root']['db'], $eventData['accountid']);
    $xmlrpc_client = new XmlRpc_Client($xmlrpc_account->mCgi, $xmlrpc_account->mHost, $xmlrpc_account->mPort);
    $xmlrpc_client->SetProxy($xmlrpc_account->mProxy, $xmlrpc_account->mProxyPort);
    $xmlrpc_client->SetCredentials($xmlrpc_account->mUsername, $xmlrpc_account->mPassword);
    $xmlrpc_message = new XmlRpcMsg('system.listMethods');
    $xmlrpc_resp = $xmlrpc_client->Send($xmlrpc_message);
    if ($xmlrpc_resp) {
        if (!$xmlrpc_resp->FaultCode()) {
            $xv = $xmlrpc_resp->Value();
            if (is_object($xv)) {
                $methods = xmlrpc_decode($xv);
                //$methods_val = $xv->ScalarVal();
                if (is_array($methods)) {
                    $headers[0]['label'] = $amp_locale->GetStr('method.header');
                    $methods_table = new HuiTable('methods', array('elements' => $elements, 'headers' => $headers, 'rowsperpage' => '20', 'pagesactionfunction' => 'methods_list_action_builder', 'pagenumber' => $eventData['methodspage']));
                    $row = 0;
                    while (list($key, $val) = each($methods)) {
                        $methods_table->AddChild(new HuiLabel('method', array('label' => $val)), $row, 0);
                        $row++;
                    }
                    $hui_vgroup->AddChild($methods_table);
                }
            }
        } else {
            echo 'error in response from server';
        }
    } else {
        echo 'invalid response form server';
    }
    //$hui_vgroup
    $hui_mainframe->AddChild($hui_vgroup);
    $hui_titlebar->mTitle .= ' - ' . $acc_data['name'] . ' - ' . $amp_locale->GetStr('showmethods_title');
}
Esempio n. 3
0
function main_sitemodules($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar;
    $site_query =& $env['ampdb']->execute('SELECT * FROM sites WHERE id=' . $eventData['siteid']);
    $site_data = $site_query->Fields();
    $modules_query =& $env['ampdb']->Execute('SELECT * FROM modules WHERE onlyextension <> ' . $env['ampdb']->Format_Text($env['ampdb']->fmttrue) . ' ORDER BY modid');
    if ($modules_query) {
        if ($modules_query->NumRows()) {
            $headers[0]['label'] = $amp_locale->GetStr('status_header');
            $headers[1]['label'] = $amp_locale->GetStr('moduleid_header');
            $headers[2]['label'] = $amp_locale->GetStr('modactivationdate_header');
            $headers[4]['label'] = $amp_locale->GetStr('moddeps_header');
            $row = 0;
            $hui_sitemodules_table = new HuiTable('sitemodulestable', array('headers' => $headers));
            OpenLibrary('modulesbase.library');
            while (!$modules_query->eof) {
                $modules_data = $modules_query->Fields();
                if ($modules_data['modid'] != 'ampoliros') {
                    $act_query =& $env['ampdb']->Execute('SELECT * FROM activemodules WHERE siteid = ' . $eventData['siteid'] . ' AND moduleid = ' . $modules_data['id']);
                    $hui_en_group[$row] = new HuiVertGroup('enable');
                    $hui_sitemodules_toolbar[$row] = new HuiToolBar('sitemodulestoolbar' . $row);
                    $mod_dep = new ModuleDep($env['ampdb']);
                    if ($act_query->NumRows()) {
                        // Module is enabled
                        //
                        $act_data = $act_query->Fields();
                        $hui_sitemodules_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $hui_mainframe->mThemeHandler->mStyle['greenball'])), $row, 0);
                        $hui_sitemodules_table->AddChild(new HuiLabel('modid' . $row, array('label' => $modules_data['modid'], 'compact' => 'true')), $row, 1);
                        $hui_sitemodules_table->AddChild(new HuiLabel('actdate' . $row, array('label' => $act_data['activationdate'], 'compact' => 'true')), $row, 2);
                        $site_depending_modules = $mod_dep->CheckSiteDependingModules($modules_data['modid'], $site_data['siteid']);
                        $module = new Module($env['ampdb'], $modules_data['id']);
                        $sub_modules = $module->GetSubModules();
                        if (!$site_depending_modules) {
                            // No modules depends on this one
                            //
                            $disable_action[$row] = new HuiEventsCall();
                            $disable_action[$row]->AddEvent(new HuiEvent('main', 'sitemodules', array('siteid' => $eventData['siteid'])));
                            $disable_action[$row]->AddEvent(new HuiEvent('pass', 'deactivatemodule', array('siteid' => $eventData['siteid'], 'modid' => $modules_data['id'])));
                            $hui_disable_button[$row] = new HuiButton('disablebutton' . $row, array('label' => $amp_locale->GetStr('deactivatemodule_label'), 'compact' => 'true', 'horiz' => 'true', 'themeimage' => 'stop', 'themeimagetype' => 'mini', 'action' => $disable_action[$row]->GetEventsCallString()));
                            $hui_sitemodules_toolbar[$row]->AddChild($hui_disable_button[$row]);
                            $hui_en_group[$row]->AddChild($hui_sitemodules_toolbar[$row]);
                        } else {
                            // At least one module depends on this one
                            //
                            $mod_dep_list_str = '';
                            while (list(, $dep) = each($site_depending_modules)) {
                                $mod_dep_list_str .= $dep . '<br>';
                            }
                            $hui_sitemodules_table->AddChild(new HuiLabel('moddeps' . $row, array('label' => $mod_dep_list_str)), $row, 4);
                        }
                        if (count($sub_modules)) {
                            $toolbar = array();
                            while (list(, $name) = each($sub_modules)) {
                                $enabled = $module->CheckIfSubModuleEnabled($name, $eventData['siteid']);
                                $toolbar['main']['enable'] = array('label' => sprintf($amp_locale->GetStr(($enabled ? 'disable' : 'enable') . '_submodule.button'), ucfirst($name)), 'themeimage' => $enabled ? 'stop' : 'reload', 'compact' => 'true', 'themeimagetype' => 'mini', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'sitemodules', array('siteid' => $eventData['siteid'])), array('pass', $enabled ? 'disablesubmodule' : 'enablesubmodule', array('moduleid' => $modules_data['id'], 'siteid' => $eventData['siteid'], 'submodule' => $name)))));
                                $hui_en_group[$row]->AddChild(new HuiAmpToolBar('main', array('frame' => 'false', 'toolbars' => $toolbar)));
                            }
                        }
                        $hui_sitemodules_table->AddChild($hui_en_group[$row], $row, 3);
                    } else {
                        // Module is not enabled
                        //
                        $hui_sitemodules_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $hui_mainframe->mThemeHandler->mStyle['redball'])), $row, 0);
                        $hui_sitemodules_table->AddChild(new HuiLabel('modid' . $row, array('label' => $modules_data['modid'])), $row, 1);
                        $site_module_deps = $mod_dep->CheckSiteModuleDeps($modules_data['modid'], $site_data['siteid'], DEPTYPE_DEP);
                        if (!is_array($site_module_deps)) {
                            // All module dependecies are met
                            //
                            $enable_action[$row] = new HuiEventsCall();
                            $enable_action[$row]->AddEvent(new HuiEvent('main', 'sitemodules', array('siteid' => $eventData['siteid'])));
                            $enable_action[$row]->AddEvent(new HuiEvent('pass', 'activatemodule', array('siteid' => $eventData['siteid'], 'modid' => $modules_data['id'])));
                            $hui_enable_button[$row] = new HuiButton('enablebutton' . $row, array('label' => $amp_locale->GetStr('activatemodule_label'), 'compact' => 'true', 'horiz' => 'true', 'themeimage' => 'reload', 'themeimagetype' => 'mini', 'action' => $enable_action[$row]->GetEventsCallString()));
                            $hui_sitemodules_toolbar[$row]->AddChild($hui_enable_button[$row]);
                        } else {
                            // At least one module dependency is not met
                            //
                            $mod_dep_list_str = '';
                            while (list(, $dep) = each($site_module_deps)) {
                                $mod_dep_list_str .= $dep . '<br>';
                            }
                            $hui_sitemodules_table->AddChild(new HuiLabel('moddeps' . $row, array('label' => $mod_dep_list_str)), $row, 4);
                        }
                        $hui_sitemodules_table->AddChild($hui_sitemodules_toolbar[$row], $row, 3);
                    }
                    $row++;
                }
                $modules_query->MoveNext();
            }
            $xml_def = '<toolbar>
              <children>
            
                <button>
                  <args>
                    <themeimage>reload</themeimage>
                    <label type="encoded">' . urlencode($amp_locale->GetStr('enable_all_modules.button')) . '</label>
                    <horiz>true</horiz>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'sitemodules', array('siteid' => $eventData['siteid'])), array('pass', 'activateallmodules', array('siteid' => $eventData['siteid']))))) . '</action>
                  </args>
                </button>
            
                <button>
                  <args>
                    <themeimage>stop</themeimage>
                    <label type="encoded">' . urlencode($amp_locale->GetStr('disable_all_modules.button')) . '</label>
                    <horiz>true</horiz>
                    <needconfirm>true</needconfirm>
                    <confirmmessage type="encoded">' . urlencode($amp_locale->GetStr('disable_all_modules.confirm')) . '</confirmmessage>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'sitemodules', array('siteid' => $eventData['siteid'])), array('pass', 'deactivateallmodules', array('siteid' => $eventData['siteid']))))) . '</action>
                  </args>
                </button>
            
              </children>
            </toolbar>';
            $hui_mainvgroup = new HuiVertGroup();
            $hui_mainvgroup->AddChild($hui_sitemodules_table);
            $hui_mainvgroup->AddChild(new HuiHorizBar());
            $hui_mainvgroup->AddChild(new HuiXml('', array(definition => $xml_def)));
            $hui_mainframe->AddChild($hui_mainvgroup);
        }
    }
    $hui_titlebar->mTitle .= ' - ' . $site_data['siteid'] . ' (' . $site_data['sitename'] . ') - ' . $amp_locale->GetStr('sitemodules_title');
}
Esempio n. 4
0
 clearstatcache();
 // Checks if there are remaining setup phases
 //
 if (!file_exists(AMP_SETUP_LOCK)) {
     main_page(TRUE);
 } else {
     import('com.solarix.ampoliros.dblayer.DBLayerFactory');
     // System check
     //
     if (!file_exists(TMP_PATH . '.systemchecked')) {
         $systemok = true;
         $row = 0;
         @touch(TMP_PATH . '.checkingsystem', time());
         // !!! $page->add( new HTMLScript( 'JavaScript1.2', 'parent.frames.sum.location.reload()', '' ) );
         $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('systemcheck_title');
         $hui_info_table = new HuiTable('sysinfotable', array('headers' => $headers));
         // Required features
         // /ampcgi/ alias
         //
         $row = 0;
         if (@fopen(CGI_URL . 'clear.gif', 'r')) {
             $ball = $hui_page->mThemeHandler->mStyle['greenball'];
             $check_result = $amp_locale->GetStr('ampcgi_available_label');
         } else {
             $ball = $hui_page->mThemeHandler->mStyle['redball'];
             $check_result = sprintf($amp_locale->GetStr('ampcgi_not_available_label'), CGI_URL, CGI_URL);
             $systemok = false;
         }
         $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('required_label'))), $row, 0);
         $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
         $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => sprintf($amp_locale->GetStr('ampcgi_test_label'), CGI_URL))), $row, 2);
Esempio n. 5
0
function main_sysinfo($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $pass_disp, $hui_mainstatus;
    /*$headers[0]['label'] = $amp_locale->GetStr( 'status_header' );
      $headers[1]['label'] = $amp_locale->GetStr( 'moduleid_header' );
      $headers[2]['label'] = $amp_locale->GetStr( 'modactivationdate_header' );
      $headers[3]['label'] = $amp_locale->GetStr( 'moddeps_header' );*/
    $hui_info_table = new HuiTable('sysinfotable', '');
    // Required features
    // /ampcgi/ alias
    //
    $row = 0;
    if (@fopen(((isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://') . AMP_HOST . CGI_URL . 'clear.gif', 'r')) {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = $amp_locale->GetStr('ampcgi_available_label');
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['redball'];
        $check_result = sprintf($amp_locale->GetStr('ampcgi_not_available_label'), CGI_URL, AMP_HOST . CGI_URL);
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('required_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => sprintf($amp_locale->GetStr('ampcgi_test_label'), CGI_URL))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    // PHP version check
    //
    $row++;
    //if ( ereg( '[4-9]\.[0-9]\.[5-9].*', phpversion() ) or ereg( '[4-9]\.[1-9]\.[0-9].*', phpversion() ) )
    if (ereg("[5-9]\\.[0-9]\\.[0-9].*", phpversion())) {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = sprintf($amp_locale->GetStr('php_available_label'), phpversion());
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['redball'];
        $check_result = sprintf($amp_locale->GetStr('php_not_available_label'), phpversion());
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('required_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('php_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    // File upload support
    //
    $row++;
    if (ini_get('file_uploads') == '1') {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = $amp_locale->GetStr('fileupload_available_label');
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['redball'];
        $check_result = $amp_locale->GetStr('fileupload_not_available_label');
        $systemok = false;
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('required_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('fileupload_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    // XML support
    //
    $row++;
    if (function_exists('xml_set_object')) {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = $amp_locale->GetStr('xml_available_label');
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['redball'];
        $check_result = $amp_locale->GetStr('xml_not_available_label');
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('required_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('xml_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    // Zlib support
    //
    $row++;
    if (function_exists('gzinflate')) {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = $amp_locale->GetStr('zlib_available_label');
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['redball'];
        $check_result = $amp_locale->GetStr('zlib_not_available_label');
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('required_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('zlib_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    // Database support
    //
    $row++;
    if (function_exists('mysql_connect') or function_exists('pg_connect')) {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = $amp_locale->GetStr('db_available_label');
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['redball'];
        $check_result = $amp_locale->GetStr('db_not_available_label');
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('required_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('db_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    // Optional features
    // Crontab
    //
    $row++;
    if (strlen(ROOTCRONTAB)) {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = $amp_locale->GetStr('crontab_available_label');
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['goldball'];
        $check_result = $amp_locale->GetStr('crontab_not_available_label');
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('optional_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('crontab_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    // XMLRPC auth
    //
    $row++;
    if (php_sapi_name() != 'cgi') {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = $amp_locale->GetStr('xmlrpc_available_label');
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['goldball'];
        $check_result = $amp_locale->GetStr('xmlrpc_not_available_label');
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('optional_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('xmlrpc_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    // XMLRPC curl
    //
    $row++;
    if (function_exists('curl_init')) {
        $ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
        $check_result = $amp_locale->GetStr('xmlrpc_ssl_available_label');
    } else {
        $ball = $hui_mainframe->mThemeHandler->mStyle['goldball'];
        $check_result = $amp_locale->GetStr('xmlrpc_ssl_not_available_label');
    }
    $hui_info_table->AddChild(new HuiLabel('required' . $row, array('label' => $amp_locale->GetStr('optional_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $ball)), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('xmlrpc_ssl_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => $check_result)), $row, 3);
    /*
    	// Windows COM auth
    	//
    	$row++;
    
    	if ( function_exists( 'com_load' ) )
    	{
    		$ball = $hui_mainframe->mThemeHandler->mStyle['greenball'];
    		$check_result = $amp_locale->GetStr( 'com_available_label' );
    	}
    	else
            {
                $ball = $hui_mainframe->mThemeHandler->mStyle['goldball'];
    		$check_result = $amp_locale->GetStr( 'com_not_available_label' );
    	}
    
    	$hui_info_table->AddChild( new HuiLabel( 'required'.$row, array( 'label' => $amp_locale->GetStr( 'optional_label' ) ) ), $row, 0 );
    	$hui_info_table->AddChild( new HuiImage( 'status'.$row, array( 'imageurl' => $ball ) ), $row, 1 );
    	$hui_info_table->AddChild( new HuiLabel( 'ampcgi'.$row, array( 'label' => $amp_locale->GetStr( 'com_test_label' ) ) ), $row, 2 );
    	$hui_info_table->AddChild( new HuiLabel( 'checkresult'.$row, array( 'label' => $check_result ) ), $row, 3 );
    */
    // Informations
    // Operating system
    //
    $row++;
    $hui_info_table->AddChild(new HuiLabel('info' . $row, array('label' => $amp_locale->GetStr('info_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $hui_mainframe->mThemeHandler->mStyle['greenball'])), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('os_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => PHP_OS)), $row, 3);
    // Web server interface
    //
    $row++;
    $hui_info_table->AddChild(new HuiLabel('info' . $row, array('label' => $amp_locale->GetStr('info_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $hui_mainframe->mThemeHandler->mStyle['greenball'])), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('webserver_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => php_sapi_name())), $row, 3);
    // Current user
    //
    $row++;
    $hui_info_table->AddChild(new HuiLabel('info' . $row, array('label' => $amp_locale->GetStr('info_label'))), $row, 0);
    $hui_info_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $hui_mainframe->mThemeHandler->mStyle['greenball'])), $row, 1);
    $hui_info_table->AddChild(new HuiLabel('ampcgi' . $row, array('label' => $amp_locale->GetStr('user_test_label'))), $row, 2);
    $hui_info_table->AddChild(new HuiLabel('checkresult' . $row, array('label' => get_current_user())), $row, 3);
    $hui_mainframe->AddChild($hui_info_table);
}
Esempio n. 6
0
function main_showmodule($eventData)
{
    global $env, $amp_locale, $hui_mainframe, $hui_titlebar;
    $query =& $env['ampdb']->execute('SELECT modid ' . 'FROM modules ' . 'WHERE id=' . $eventData['modid'] . ' ');
    $module_data = $query->Fields();
    $deffile = new XMLDefFile($env['ampdb'], PRIVATE_TREE);
    $deffile->Load_DefFile(MODULE_PATH . $module_data['modid'] . '/structure.xml');
    $structure = $deffile->Get_Structure();
    ksort($structure);
    $headers[0]['label'] = $amp_locale->GetStr('elementtype_header');
    $headers[1]['label'] = $amp_locale->GetStr('elementname_header');
    $headers[2]['label'] = $amp_locale->GetStr('elementattrs_header');
    $row = 0;
    $hui_modules_table = new HuiTable('modulestable', array('headers' => $headers, 'rowsperpage' => '20', 'pagesactionfunction' => 'show_module_action_builder', 'pagenumber' => isset($eventData['pagenumber']) ? $eventData['pagenumber'] : '', 'sessionobjectusername' => $module_data['modid']));
    while (list($type, $elems) = each($structure)) {
        if (is_array($elems)) {
            asort($elems);
            while (list($elem, $attrs) = each($elems)) {
                $attrs_string = '';
                while (list($key, $val) = each($attrs)) {
                    if (strcmp($key, 'name')) {
                        $attrs_string .= '<b>' . $key . '</b>: ' . $val . '. ';
                    }
                }
                $hui_modules_table->AddChild(new HuiLabel('elementtypelabel' . $row, array('label' => $type)), $row, 0);
                $hui_modules_table->AddChild(new HuiLabel('elementnamelabel' . $row, array('label' => $attrs['name'])), $row, 1);
                $hui_modules_table->AddChild(new HuiLabel('elementattrslabel' . $row, array('label' => $attrs_string)), $row, 2);
                $row++;
            }
        }
    }
    $hui_mainframe->AddChild($hui_modules_table);
    $hui_titlebar->mTitle .= ' - ' . $module_data['modid'] . ' - ' . $amp_locale->GetStr('modulestructure_title');
}