Ejemplo n.º 1
0
function main_default($eventData)
{
    global $hui_mainframe, $amp_locale, $hui_titlebar;
    $hui_grid = new HuiGrid('grid', array('rows' => '3', 'cols' => '2'));
    $hui_grid->AddChild(new HuiLabel('oldpasswordlabel', array('label' => $amp_locale->GetStr('amppasswordold_label'))), 0, 0);
    $hui_grid->AddChild(new HuiString('oldpassword', array('disp' => 'pass', 'password' => 'true')), 0, 1);
    $hui_grid->AddChild(new HuiLabel('newpasswordalabel', array('label' => $amp_locale->GetStr('amppassworda_label'))), 1, 0);
    $hui_grid->AddChild(new HuiString('newpassworda', array('disp' => 'pass', 'password' => 'true')), 1, 1);
    $hui_grid->AddChild(new HuiLabel('newpasswordblabel', array('label' => $amp_locale->GetStr('amppasswordb_label'))), 2, 0);
    $hui_grid->AddChild(new HuiString('newpasswordb', array('disp' => 'pass', 'password' => 'true')), 2, 1);
    $hui_vgroup = new HuiVertGroup('vertgroup', array('align' => 'center'));
    $hui_vgroup->AddChild($hui_grid);
    $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('amppasschange_submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $form_events_call->AddEvent(new HuiEvent('pass', 'edit', ''));
    $hui_form = new HuiForm('form', array('action' => $form_events_call->GetEventsCallString()));
    $hui_form->AddChild($hui_vgroup);
    $hui_mainframe->AddChild($hui_form);
}
Ejemplo n.º 2
0
function main_chprofile($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar;
    $user_query =& $env['ampdb']->execute('SELECT * ' . 'FROM users ' . 'WHERE id=' . $eventData['userid'] . ' ');
    $user_data = $user_query->Fields();
    $prof_query =& $env['db']->Execute('SELECT * ' . 'FROM groups ' . 'ORDER BY groupname');
    $profiles = array();
    $profiles[0] = $amp_locale->GetStr('noprofileid_label');
    while (!$prof_query->eof) {
        $prof_data = $prof_query->Fields();
        $profiles[$prof_data['id']] = $prof_data['groupname'];
        $prof_query->MoveNext();
    }
    $hui_vgroup = new HuiVertGroup('vgroup');
    $hui_user_grid = new HuiGrid('chprofilegrid', array('rows' => '2', 'cols' => '2'));
    // User fields
    //
    $hui_user_grid->AddChild(new HuiLabel('profilelabel', array('label' => $amp_locale->GetStr('changeprofile_label') . ' (*)')), 0, 0);
    $hui_user_grid->AddChild(new HuiComboBox('profileid', array('disp' => 'pass', 'elements' => $profiles, 'default' => $user_data['groupid'])), 0, 1);
    $hui_vgroup->AddChild($hui_user_grid);
    $hui_vgroup->AddChild(new HuiSubmit('submit1', array('caption' => $amp_locale->GetStr('chprofile_submit'))));
    $hui_vgroup->AddChild(new HuiHorizBar('horizbar1'));
    $hui_vgroup->AddChild(new HuiLabel('reqfieldslabel', array('label' => $amp_locale->GetStr('requiredfields_label'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'chprofile', array('uid' => $eventData['userid'])));
    $form_events_call->AddEvent(new HuiEvent('main', 'users', ''));
    $hui_form = new HuiForm('chprofileform', array('action' => $form_events_call->GetEventsCallString()));
    $hui_form->AddChild($hui_vgroup);
    $hui_mainframe->AddChild($hui_form);
    $hui_titlebar->mTitle .= ' - ' . $user_data['username'] . ' - ' . $amp_locale->GetStr('chprofile_title');
}
Ejemplo n.º 3
0
$hui_titlebar = new HuiTitleBar('titlebar', array('title' => $amp_locale->GetStr('interface_title'), 'icon' => 'kcontrol'));
$hui_mainvertgroup->AddChild($hui_titlebar);
// Main tool bar
//
$hui_maintoolbar = new HuiToolBar('maintoolbar');
$default_action = new HuiEventsCall();
$default_action->AddEvent(new HuiEvent('main', 'default', ''));
$hui_defaultbutton = new HuiButton('defaultbutton', array('label' => $amp_locale->GetStr('default_button'), 'themeimage' => 'thumbnail', 'horiz' => 'true', 'action' => $default_action->GetEventsCallString()));
$hui_maintoolbar->AddChild($hui_defaultbutton);
// Help tool bar
//
$hui_helptoolbar = new HuiToolBar('helpbar');
$main_disp = new HuiDispatcher('main');
$event_name = $main_disp->GetEventName();
if (strcmp($event_name, 'help')) {
    $help_action = new HuiEventsCall();
    $help_action->AddEvent(new HuiEvent('main', 'help', array('node' => $event_name)));
    $hui_helpbutton = new HuiButton('helpbutton', array('label' => $amp_locale->GetStr('help_button'), 'themeimage' => 'help', 'horiz' => 'true', 'action' => $help_action->GetEventsCallString()));
    $hui_helptoolbar->AddChild($hui_helpbutton);
}
// Toolbar frame
//
$hui_toolbarframe = new HuiHorizGroup('toolbarframe');
$hui_toolbarframe->AddChild($hui_maintoolbar);
$hui_toolbarframe->AddChild($hui_helptoolbar);
$hui_mainvertgroup->AddChild($hui_toolbarframe);
$hui_mainframe = new HuiVertFrame('mainframe');
$hui_mainstatus = new HuiStatusBar('mainstatusbar');
// Pass dispatcher
//
$pass_disp = new HuiDispatcher('pass');
Ejemplo n.º 4
0
function main_updateaccount($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar;
    $acc_query =& $env['ampdb']->execute('SELECT * ' . 'FROM xmlrpcaccounts ' . 'WHERE id=' . $eventData['accountid']);
    $acc_data = $acc_query->Fields();
    $hui_vgroup = new HuiVertGroup('vgroup');
    $hui_form_grid = new HuiGrid('newaccountgrid', array('rows' => '6', 'cols' => '2'));
    $hui_form_grid->AddChild(new HuiLabel('namelabel', array('label' => $amp_locale->GetStr('accountname_label') . ' (*)')), 0, 0);
    $hui_form_grid->AddChild(new HuiString('name', array('disp' => 'pass', 'value' => $acc_data['name'])), 0, 1);
    $hui_form_grid->AddChild(new HuiLabel('hostlabel', array('label' => $amp_locale->GetStr('host_label') . ' (*)')), 1, 0);
    $hui_form_grid->AddChild(new HuiString('host', array('disp' => 'pass', 'value' => $acc_data['host'])), 1, 1);
    $hui_form_grid->AddChild(new HuiLabel('cgilabel', array('label' => $amp_locale->GetStr('cgi_label') . ' (*)')), 2, 0);
    $hui_form_grid->AddChild(new HuiString('cgi', array('disp' => 'pass', 'value' => $acc_data['cgi'])), 2, 1);
    $hui_form_grid->AddChild(new HuiLabel('portlabel', array('label' => $amp_locale->GetStr('port_label') . ' (*)')), 3, 0);
    $hui_form_grid->AddChild(new HuiString('port', array('disp' => 'pass', 'value' => $acc_data['port'])), 3, 1);
    $hui_form_grid->AddChild(new HuiLabel('usernamelabel', array('label' => $amp_locale->GetStr('username_label') . ' (*)')), 4, 0);
    $hui_form_grid->AddChild(new HuiString('username', array('disp' => 'pass', 'value' => $acc_data['username'])), 4, 1);
    $hui_form_grid->AddChild(new HuiLabel('passwordlabel', array('label' => $amp_locale->GetStr('password_label') . ' (*)')), 5, 0);
    $hui_form_grid->AddChild(new HuiString('password', array('disp' => 'pass', 'password' => 'true', 'value' => $acc_data['password'])), 5, 1);
    $hui_form_grid->AddChild(new HuiLabel('proxylabel', array('label' => $amp_locale->GetStr('proxy_label'))), 6, 0);
    $hui_form_grid->AddChild(new HuiString('proxy', array('disp' => 'pass', 'value' => $acc_data['proxy'])), 6, 1);
    $hui_form_grid->AddChild(new HuiLabel('proxyportlabel', array('label' => $amp_locale->GetStr('proxyport_label'))), 7, 0);
    $hui_form_grid->AddChild(new HuiString('proxyport', array('disp' => 'pass', 'value' => $acc_data['proxyport'])), 7, 1);
    $hui_vgroup->AddChild($hui_form_grid);
    $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('updateaccount_submit'))));
    $hui_vgroup->AddChild(new HuiHorizBar('horizbar1'));
    $hui_vgroup->AddChild(new HuiLabel('reqfieldslabel', array('label' => $amp_locale->GetStr('requiredfields_label'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'updateaccount', array('accountid' => $eventData['accountid'])));
    $form_events_call->AddEvent(new HuiEvent('main', 'accounts', ''));
    $hui_form = new HuiForm('newsiteform', array('action' => $form_events_call->GetEventsCallString()));
    $hui_form->AddChild($hui_vgroup);
    $hui_mainframe->AddChild($hui_form);
    $hui_titlebar->mTitle .= ' - ' . $acc_data['name'] . ' - ' . $amp_locale->GetStr('updateaccount_title');
}
Ejemplo n.º 5
0
 function DoAuth($wrong = false, $reason = '')
 {
     global $gEnv;
     $amp_locale = new Locale('amp_misc_auth', AMP_LANG);
     $amp = Ampoliros::instance('Ampoliros');
     $amp->startRoot();
     $hui = new Hui($gEnv['root']['db']);
     $hui->LoadWidget('button');
     $hui->LoadWidget('formarg');
     $hui->LoadWidget('form');
     $hui->LoadWidget('grid');
     $hui->LoadWidget('horizbar');
     $hui->LoadWidget('horizframe');
     $hui->LoadWidget('horizgroup');
     $hui->LoadWidget('image');
     $hui->LoadWidget('label');
     $hui->LoadWidget('link');
     $hui->LoadWidget('page');
     $hui->LoadWidget('sessionkey');
     $hui->LoadWidget('statusbar');
     $hui->LoadWidget('string');
     $hui->LoadWidget('submit');
     $hui->LoadWidget('titlebar');
     $hui->LoadWidget('vertframe');
     $hui->LoadWidget('vertgroup');
     $hui_page = new HuiPage('loginpage', array('title' => $amp_locale->GetStr('amplogin'), 'border' => 'false'));
     $hui_topgroup = new HuiVertGroup('topgroup', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '100%'));
     $hui_maingroup = new HuiVertGroup('maingroup', array('align' => 'center'));
     $hui_titlebar = new HuiTitleBar('titlebar', array('title' => $amp_locale->GetStr('amplogin'), 'closewidget' => 'false', 'newwindowwidget' => 'false'));
     $hui_mainbframe = new HuiVertFrame('vframe', array('align' => 'center'));
     $hui_mainframe = new HuiHorizGroup('horizframe');
     $hui_mainstatus = new HuiStatusBar('mainstatusbar');
     // Main frame
     //
     $hui_grid = new HuiGrid('grid', array('rows' => '2', 'cols' => '2'));
     $hui_grid->AddChild(new HuiLabel('usernamelabel', array('label' => $amp_locale->GetStr('username'))), 0, 0);
     $hui_grid->AddChild(new HuiString('username', array('disp' => 'login')), 0, 1);
     $hui_grid->AddChild(new HuiLabel('passwordlabel', array('label' => $amp_locale->GetStr('password'))), 1, 0);
     $hui_grid->AddChild(new HuiString('password', array('disp' => 'login', 'password' => 'true')), 1, 1);
     $hui_vgroup = new HuiVertGroup('vertgroup', array('align' => 'center'));
     //$hui_vgroup->AddChild( new HuiLabel( 'titlelabel', array( 'label' => $amp_locale->GetStr( 'amprootlogin' ) ) ) );
     $hui_vgroup->AddChild($hui_grid);
     $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('enter'))));
     $form_events_call = new HuiEventsCall();
     $form_events_call->AddEvent(new HuiEvent('login', 'login', ''));
     $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
     $hui_form = new HuiForm('form', array('action' => $form_events_call->GetEventsCallString()));
     $hui_hgroup = new HuiHorizGroup('horizgroup', array('align' => 'middle'));
     //        $hui_hgroup -> AddChild(new HuiButton('amplogo', array('image' => $hui_page -> mThemeHandler -> mStyle['middot'], 'action' => AMP_URL, 'highlight' => false)));
     $hui_hgroup->AddChild(new HuiButton('password', array('themeimage' => 'password', 'themeimagetype' => 'big', 'action' => AMP_URL, 'highlight' => false)));
     $hui_hgroup->AddChild($hui_vgroup);
     $hui_form->AddChild($hui_hgroup);
     $hui_mainframe->AddChild($hui_form);
     // Wrong account check
     //
     if ($wrong) {
         if ($gEnv['core']['config']->Value('ALERT_ON_WRONG_LOCAL_USER_LOGIN') == '1') {
             Carthag::import('com.solarix.ampoliros.security.SecurityLayer');
             global $login_disp;
             $event_data = $login_disp->GetEventData();
             $amp_security = new SecurityLayer();
             $amp_security->SendAlert('Wrong user local login for user ' . $event_data['username'] . ' from remote address ' . $_SERVER['REMOTE_ADDR']);
             $amp_security->LogFailedAccess($event_data['username'], false, $_SERVER['REMOTE_ADDR']);
             unset($amp_security);
         }
         $sleep_time = $gEnv['core']['config']->Value('WRONG_LOGIN_DELAY');
         if (!strlen($sleep_time)) {
             $sleep_time = 1;
         }
         $max_attempts = $gEnv['core']['config']->Value('MAX_WRONG_LOGINS');
         if (!strlen($max_attempts)) {
             $max_attempts = 3;
         }
         sleep($sleep_time);
         if (isset($_SESSION['site_login_attempts'])) {
             $_SESSION['site_login_attempts']++;
             if ($_SESSION['site_login_attempts'] >= $max_attempts) {
                 AmpDie($amp_locale->GetStr('wrongpwd'));
             }
         } else {
             $_SESSION['site_login_attempts'] = 1;
         }
         if ($reason) {
             $hui_mainstatus->mArgs['status'] = $amp_locale->GetStr($reason);
         } else {
             $hui_mainstatus->mArgs['status'] = $amp_locale->GetStr('wrongpwd');
         }
     } else {
         $_SESSION['site_login_attempts'] = 0;
     }
     // Page render
     //
     $hui_maingroup->AddChild($hui_titlebar);
     //$hui_maingroup->AddChild( new HuiButton( 'amplogo', array( 'image' => CGI_URL.'ampbigdot.gif', 'action' => AMP_URL ) ) );
     $hui_mainbframe->AddChild($hui_mainframe);
     $hui_mainbframe->AddChild(new HuiHorizBar('hb'));
     $hui_mainbframe->AddChild(new HuiLink('copyright', array('label' => $amp_locale->GetStr('auth_copyright.label'), 'link' => 'http://www.solarix.it/', 'target' => '_blank')));
     $hui_maingroup->AddChild($hui_mainbframe);
     $hui_maingroup->AddChild($hui_mainstatus);
     $hui_topgroup->AddChild($hui_maingroup);
     $hui_page->AddChild($hui_topgroup);
     $hui->AddChild($hui_page);
     $hui->Render();
     $carthag = Carthag::instance();
     $carthag->halt();
 }
Ejemplo n.º 6
0
function main_showsitedblog($eventData)
{
    global $env, $dbtypes, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar, $hui_mainvertgroup;
    $query =& $env['ampdb']->execute('SELECT * ' . 'FROM sites ' . 'WHERE id=' . $eventData['siteid']);
    if ($query->NumRows()) {
        $site_data = $query->Fields();
        $hui_vgroup = new HuiVertGroup('vgroup');
        $db_log_content = '';
        if (file_exists($site_data['sitedblog'])) {
            $log_toolbar = new HuiToolBar('logbar');
            $cleanlog_action = new HuiEventsCall();
            $cleanlog_action->AddEvent(new HuiEvent('main', 'showsitedblog', array('siteid' => $eventData['siteid'])));
            $cleanlog_action->AddEvent(new HuiEvent('pass', 'cleansitedblog', array('siteid' => $eventData['siteid'])));
            $cleanlog_button = new HuiButton('cleanlogbutton', array('label' => $amp_locale->GetStr('cleanlog_button'), 'themeimage' => 'editdelete', 'action' => $cleanlog_action->GetEventsCallString()));
            $log_toolbar->AddChild($cleanlog_button);
            $log_frame = new HuiHorizFrame('logframe');
            $log_frame->AddChild($log_toolbar);
            $hui_mainvertgroup->AddChild($log_frame);
            $db_log_content = file_get_contents($site_data['sitedblog']);
        }
        $hui_vgroup->AddChild(new HuiText('sitedblog', array('disp' => 'pass', 'readonly' => 'true', 'value' => htmlentities($db_log_content), 'rows' => '20', 'cols' => '120')), 0, 1);
        $hui_mainframe->AddChild($hui_vgroup);
    }
    $hui_titlebar->mTitle .= ' - ' . $site_data['siteid'] . ' (' . $site_data['sitename'] . ') - ' . $amp_locale->GetStr('showsitedblog_title');
}
Ejemplo n.º 7
0
function build_events_call_string($eventsCallUrl, $eventsArray)
{
    $tmp_action = new HuiEventsCall($eventsCallUrl);
    if (is_array($eventsArray)) {
        while (list(, $event) = each($eventsArray)) {
            $tmp_action->addEvent(new HuiEvent($event[0], $event[1], isset($event[2]) ? $event[2] : ''));
        }
    }
    return $tmp_action->GetEventsCallString();
}
Ejemplo n.º 8
0
function main_edit($eventData)
{
    global $hui_mainframe, $amp_locale, $hui_titlebar;
    $hui_grid = new HuiGrid('grid', array('rows' => '3', 'cols' => '2'));
    $hui_grid->AddChild(new HuiLabel('namelabel', array('label' => $amp_locale->GetStr('namedesc'))), 0, 0);
    $hui_grid->AddChild(new HuiString('name', array('value' => AMP_NAME, 'disp' => 'pass')), 0, 1);
    $hui_grid->AddChild(new HuiLabel('domainlabel', array('label' => $amp_locale->GetStr('domaindesc'))), 1, 0);
    $hui_grid->AddChild(new HuiString('domain', array('value' => AMP_DOMAIN, 'disp' => 'pass')), 1, 1);
    $hui_grid->AddChild(new HuiLabel('dnslabel', array('label' => $amp_locale->GetStr('dnsdesc'))), 2, 0);
    $hui_grid->AddChild(new HuiString('dns', array('value' => AMP_DNS, 'disp' => 'pass')), 2, 1);
    $hui_vgroup = new HuiVertGroup('vertgroup', array('align' => 'center'));
    $hui_vgroup->AddChild($hui_grid);
    $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $form_events_call->AddEvent(new HuiEvent('pass', 'edit', ''));
    $hui_form = new HuiForm('form', array('action' => $form_events_call->GetEventsCallString()));
    $hui_form->AddChild($hui_vgroup);
    $hui_mainframe->AddChild($hui_form);
    $hui_titlebar->mTitle .= ' - Edit';
    //$hui_mainframe->AddChild( new HuiLabel( 'mainlabel', array( 'label' => 'Main page' ) ) );
}
Ejemplo n.º 9
0
function main_language($eventData)
{
    global $env, $hui_mainframe, $hui_titlebar, $amp_locale, $pass_disp, $hui_mainstatus;
    $loc_country = new LocaleCountry($env[$env['currentuser'] . '-country']);
    $country_language = $loc_country->Language();
    $language_locale = new Locale('amp_misc_locale', $env[$env['currentuser'] . '-language']);
    $selected_language = $pass_disp->GetEventData();
    $selected_language = $selected_language['language'];
    $hui_vgroup = new HuiVertGroup('vgroup');
    $language_query =& $env['ampdb']->Execute('SELECT * ' . 'FROM languages');
    while (!$language_query->eof) {
        $languages[$language_query->Fields('langshort')] = $language_locale->GetStr($language_query->Fields('langname'));
        $language_query->MoveNext();
    }
    $hui_locale_grid = new HuiGrid('localegrid', array('rows' => '1', 'cols' => '3'));
    $hui_locale_grid->AddChild(new HuiLabel('languagelabel', array('label' => $amp_locale->GetStr('language_label'))), 0, 0);
    $hui_locale_grid->AddChild(new HuiComboBox('language', array('disp' => 'pass', 'elements' => $languages, 'default' => $selected_language ? $selected_language : $env[$env['currentuser'] . '-language'])), 0, 1);
    $hui_locale_grid->AddChild(new HuiSubmit('submit1', array('caption' => $amp_locale->GetStr('language_submit'))), 0, 2);
    $hui_vgroup->AddChild($hui_locale_grid);
    $hui_vgroup->AddChild(new HuiHorizBar('horizbar1'));
    $hui_vgroup->AddChild(new HuiLabel('deflanglabel', array('label' => sprintf($amp_locale->GetStr('countrylanguage_label'), $languages[$country_language]))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'setlanguage', ''));
    $form_events_call->AddEvent(new HuiEvent('main', 'language', ''));
    $hui_form = new HuiForm('languageform', array('action' => $form_events_call->GetEventsCallString()));
    $hui_form->AddChild($hui_vgroup);
    $hui_mainframe->AddChild($hui_form);
    $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('language_title');
}
Ejemplo n.º 10
0
     $hui_vgroup2->AddChild(new HuiHorizBar('hr'));
     $hui_vgroup2->AddChild($next_button);
     setup_check_log($hui_vgroup2);
     $hui_mainframe->AddChild($hui_vgroup2);
     $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('password_title');
 } else {
     if (!file_exists(TMP_PATH . '.ampcentralset')) {
         @touch(TMP_PATH . '.settingampcentral', time());
         $hui_vgroup = new HuiVertGroup('vgroup');
         $hui_ampcentral_grid = new HuiGrid('grid');
         $hui_ampcentral_grid->AddChild(new HuiCheckBox('ampcentral', array('disp' => 'pass', 'checked' => 'true')), 0, 0);
         $hui_ampcentral_grid->AddChild(new HuiLabel('ampcentrallabel', array('label' => $amp_locale->GetStr('ampcentral_label'))), 0, 1);
         $hui_vgroup->AddChild($hui_ampcentral_grid);
         $hui_vgroup->AddChild(new HuiHorizBar('horizbar1'));
         $hui_vgroup->AddChild(new HuiLabel('ampcentrallabel', array('label' => $amp_locale->GetStr('ampcentral_explain_label'), 'nowrap' => 'false')));
         $form_events_call = new HuiEventsCall();
         $form_events_call->AddEvent(new HuiEvent('pass', 'setampcentral', ''));
         $hui_form = new HuiForm('ampcentral', array('action' => $form_events_call->GetEventsCallString()));
         $hui_form->AddChild($hui_vgroup);
         $next_action = new HuiEventSCall();
         $next_action->AddEvent(new HuiEvent('pass', 'setampcentral', ''));
         $next_button = new HuiButton('nextbutton', array('label' => $amp_locale->GetStr('next_button'), 'horiz' => 'true', 'formsubmit' => 'ampcentral', 'image' => CGI_URL . 'hui-forward.gif', 'action' => $next_action->GetEventsCallString()));
         $hui_vgroup2 = new HuiVertGroup('vgroup2');
         $hui_vgroup2->AddChild($hui_form);
         $hui_vgroup2->AddChild(new HuiHorizBar('hr'));
         $hui_vgroup2->AddChild($next_button);
         setup_check_log($hui_vgroup2);
         $hui_mainframe->AddChild($hui_vgroup2);
         $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('ampcentral_title');
     } else {
         if (!file_exists(TMP_PATH . '.cleanedup')) {
Ejemplo n.º 11
0
function main_edit($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $hui_titlebar;
    $site_sets = new SiteSettings($env['db']);
    $hui_grid = new HuiGrid('grid', array('rows' => '11', 'cols' => '2'));
    $hui_grid->AddChild(new HuiLabel('sitecompletenamelabel', array('label' => $amp_locale->GetStr('sitecompletename_label'))), 0, 0);
    $hui_grid->AddChild(new HuiString('sitecompletename', array('value' => $site_sets->GetKey('sitecompletename'), 'disp' => 'pass')), 0, 1);
    $hui_grid->AddChild(new HuiLabel('siteaddressalabel', array('label' => $amp_locale->GetStr('siteaddressa_label'))), 1, 0);
    $hui_grid->AddChild(new HuiString('siteaddressa', array('value' => $site_sets->GetKey('siteaddressa'), 'disp' => 'pass')), 1, 1);
    $hui_grid->AddChild(new HuiLabel('siteaddressblabel', array('label' => $amp_locale->GetStr('siteaddressb_label'))), 2, 0);
    $hui_grid->AddChild(new HuiString('siteaddressb', array('value' => $site_sets->GetKey('siteaddressb'), 'disp' => 'pass')), 2, 1);
    $hui_grid->AddChild(new HuiLabel('sitetownlabel', array('label' => $amp_locale->GetStr('sitetown_label'))), 3, 0);
    $hui_grid->AddChild(new HuiString('sitetown', array('value' => $site_sets->GetKey('sitetown'), 'disp' => 'pass')), 3, 1);
    $hui_grid->AddChild(new HuiLabel('sitestatelabel', array('label' => $amp_locale->GetStr('sitestate_label'))), 4, 0);
    $hui_grid->AddChild(new HuiString('sitestate', array('value' => $site_sets->GetKey('sitestate'), 'disp' => 'pass')), 4, 1);
    $hui_grid->AddChild(new HuiLabel('siteziplabel', array('label' => $amp_locale->GetStr('sitezip_label'))), 5, 0);
    $hui_grid->AddChild(new HuiString('sitezip', array('value' => $site_sets->GetKey('sitezip'), 'disp' => 'pass')), 5, 1);
    $hui_grid->AddChild(new HuiLabel('sitecountrylabel', array('label' => $amp_locale->GetStr('sitecountry_label'))), 6, 0);
    $hui_grid->AddChild(new HuiString('sitecountry', array('value' => $site_sets->GetKey('sitecountry'), 'disp' => 'pass')), 6, 1);
    $hui_grid->AddChild(new HuiLabel('sitefiscalcodelabel', array('label' => $amp_locale->GetStr('sitefiscalcode_label'))), 7, 0);
    $hui_grid->AddChild(new HuiString('sitefiscalcode', array('value' => $site_sets->GetKey('sitefiscalcode'), 'disp' => 'pass')), 7, 1);
    $hui_grid->AddChild(new HuiLabel('siteemaillabel', array('label' => $amp_locale->GetStr('siteemail_label'))), 8, 0);
    $hui_grid->AddChild(new HuiString('siteemail', array('value' => $site_sets->GetKey('siteemail'), 'disp' => 'pass')), 8, 1);
    $hui_grid->AddChild(new HuiLabel('sitephonelabel', array('label' => $amp_locale->GetStr('sitephone_label'))), 9, 0);
    $hui_grid->AddChild(new HuiString('sitephone', array('value' => $site_sets->GetKey('sitephone'), 'disp' => 'pass')), 9, 1);
    $hui_grid->AddChild(new HuiLabel('sitefaxlabel', array('label' => $amp_locale->GetStr('sitefax_label'))), 10, 0);
    $hui_grid->AddChild(new HuiString('sitefax', array('value' => $site_sets->GetKey('sitefax'), 'disp' => 'pass')), 10, 1);
    /*
    $tmpmod = new moduledep( $env[ampdb] );
    
    if ( $tmpmod->isenabled( 'magellan', $env[sitedata][siteid] ) )
    {
        $data = $sets->getkey( 'sitelogo' );
    
        $query = &$env[db]->Execute( 'select * from medias order by medianame' );
        $mvalues[] = 'none';
        $mcaptions[] = $adloc->GetStr( 'nomedia' );
    
        while ( !$query->eof )
        {
            $mdata = $query->fields();
            $mvalues[] = $mdata[id];
            if ( $mdata[id] == $data ) $selected = $mdata[id];
            $mcaptions[] = $mdata['medianame'];
            $query->MoveNext();
        }
    
        $row++;
        $table[0][$row] = new htmltext( $adloc->GetStr( 'logodesc' ) );
        $table[1][$row] = new htmlformselect( '', 'sitelogo', $selected, $mvalues, $mcaptions  );
        $row++;
        $table[0][$row] = new htmltext( $adloc->GetStr( 'logonote' ) );
        $table[0][$row]->colspan = 2;
    }
    
    $hui_grid->AddChild( new HuiLabel( 'sitelogolabel', array( 'label' => $amp_locale->GetStr( 'sitelogo_label' ) ) ), 11, 0 );
    $hui_grid->AddChild( new HuiString( 'sitelogo', array( 'value' => $site_sets->GetKey( 'sitelogo' ), 'disp' => 'pass' ) ), 11, 1 );
    */
    $hui_vgroup = new HuiVertGroup('vertgroup', array('align' => 'center'));
    $hui_vgroup->AddChild($hui_grid);
    $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('editdata_submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $form_events_call->AddEvent(new HuiEvent('pass', 'edit', ''));
    $hui_form = new HuiForm('form', array('action' => $form_events_call->GetEventsCallString()));
    $hui_form->AddChild($hui_vgroup);
    $hui_mainframe->AddChild($hui_form);
    $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('edit_title');
}
Ejemplo n.º 12
0
function main_showphplog($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar, $hui_mainvertgroup;
    $hui_vgroup = new HuiVertGroup('vgroup');
    $log_content = '';
    if (file_exists(PHP_LOG)) {
        $log_toolbar = new HuiToolBar('logbar');
        $cleanlog_action = new HuiEventsCall();
        $cleanlog_action->AddEvent(new HuiEvent('main', 'showphplog', ''));
        $cleanlog_action->AddEvent(new HuiEvent('pass', 'cleanphplog', ''));
        $cleanlog_button = new HuiButton('cleanlogbutton', array('label' => $amp_locale->GetStr('cleanlog_button'), 'themeimage' => 'editdelete', 'action' => $cleanlog_action->GetEventsCallString()));
        $log_toolbar->AddChild($cleanlog_button);
        $log_frame = new HuiHorizFrame('logframe');
        $log_frame->AddChild($log_toolbar);
        $hui_mainvertgroup->AddChild($log_frame);
        if (file_exists(PHP_LOG)) {
            $log_content = file_get_contents(PHP_LOG);
        }
    }
    $hui_vgroup->AddChild(new HuiText('phplog', array('disp' => 'pass', 'readonly' => 'true', 'value' => htmlentities($log_content), 'rows' => '20', 'cols' => '120')), 0, 1);
    $hui_mainframe->AddChild($hui_vgroup);
    $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('phplog_title');
}
Ejemplo n.º 13
0
function main_modulelog($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar, $hui_mainvertgroup;
    $query = $env['ampdb']->execute('SELECT modid ' . 'FROM modules ' . 'WHERE id=' . $eventData['modid']);
    $module_data = $query->Fields();
    $hui_vgroup = new HuiVertGroup('vgroup');
    $mod_log_content = '';
    if (file_exists(MODULE_PATH . $module_data['modid'] . '/module.log')) {
        $log_toolbar = new HuiToolBar('logbar');
        $cleanlog_action = new HuiEventsCall();
        $cleanlog_action->AddEvent(new HuiEvent('main', 'default', ''));
        $cleanlog_action->AddEvent(new HuiEvent('pass', 'cleanmodlog', array('modid' => $module_data['modid'])));
        $cleanlog_button = new HuiButton('cleanlogbutton', array('label' => $amp_locale->GetStr('cleanlog_button'), 'themeimage' => 'editdelete', 'action' => $cleanlog_action->GetEventsCallString()));
        $log_toolbar->AddChild($cleanlog_button);
        $log_frame = new HuiHorizFrame('logframe');
        $log_frame->AddChild($log_toolbar);
        $hui_mainvertgroup->AddChild($log_frame);
        $mod_log_content = file_get_contentes(MODULE_PATH . $module_data['modid'] . '/module.log');
    }
    $hui_vgroup->AddChild(new HuiText('modlog', array('disp' => 'pass', 'readonly' => 'true', 'value' => htmlentities($mod_log_content), 'rows' => '20', 'cols' => '120')), 0, 1);
    $hui_mainframe->AddChild($hui_vgroup);
    $hui_titlebar->mTitle .= ' - ' . $module_data['modid'] . ' - ' . $amp_locale->GetStr('modlog.title');
}
Ejemplo n.º 14
0
                        }
                        $tmp_eventscall = new HuiEventsCall($pagedata['location']);
                        $tmp_eventscall->AddEvent(new HuiEvent('main', 'default', ''));
                        $el[$group_data['id']]['groupelements'][$cont_b]['name'] = $descstr;
                        $el[$group_data['id']]['groupelements'][$cont_b]['image'] = $pagedata['iconfile'];
                        $el[$group_data['id']]['groupelements'][$cont_b]['action'] = $tmp_eventscall->GetEventsCallString() . '&act=def';
                        $el[$group_data['id']]['groupelements'][$cont_b]['themesized'] = 'true';
                        unset($tmp_eventscall);
                        $cont_b++;
                        $pagesquery->MoveNext();
                    }
                }
            }
        }
        if ($group_data['name'] == 'tools') {
            $logout_events_call = new HuiEventsCall('index.php');
            $logout_events_call->AddEvent(new HuiEvent('login', 'logout', ''));
            $cont_a++;
            $el[$group_data['id']]['groupelements'][$cont_a]['name'] = $amp_menu_locale->GetStr('logout');
            $el[$group_data['id']]['groupelements'][$cont_a]['image'] = $hui_page->mThemeHandler->mIconsBase . $hui_page->mThemeHandler->mIconsSet['apps']['error']['base'] . '/apps/' . $hui_page->mThemeHandler->mIconsSet['apps']['error']['file'];
            $el[$group_data['id']]['groupelements'][$cont_a]['action'] = $logout_events_call->GetEventsCallString();
            $el[$group_data['id']]['groupelements'][$cont_a]['target'] = 'parent';
        }
        $groups_query->MoveNext();
        $cont_a++;
    }
}
$hui_vertframe = new HuiVertFrame('vertframe');
$hui_vertframe->AddChild(new HuiTreeMenu('treemenu', array('elements' => $el, 'width' => '120', 'target' => 'groupop', 'allgroupsactive' => 'false')));
$hui_mainvertgroup->AddChild($hui_vertframe);
$hui_page->AddChild($hui_mainvertgroup);
Ejemplo n.º 15
0
function main_default($eventData)
{
    global $env, $hui_mainframe, $hui_titlebar, $amp_locale, $pass_disp, $hui_mainstatus;
    $mod_cfg = new ModuleConfig($env['ampdb'], 'ampoliros');
    // OEM
    //
    $oem_frame = new HuiVertFrame('oemframe');
    $oem_vgroup = new HuiVertGroup('oemvgroup', array('width' => '100%'));
    $oem_vgroup->AddChild(new HuiLabel('oemlabel', array('label' => $amp_locale->GetStr('oemframe_label'), 'bold' => 'true')));
    $oem_grid = new HuiGrid('oemgrid', array('rows' => '4', 'cols' => '2'));
    // OEM name
    //
    $oem_grid->AddChild(new HuiLabel('oemname_label', array('label' => $amp_locale->GetStr('oemname_label'))), 0, 0);
    $oem_grid->AddChild(new HuiString('oemname', array('disp' => 'pass', 'size' => '30', 'value' => $mod_cfg->GetKey('oem-name'))), 0, 1);
    // OEM url
    //
    $oem_grid->AddChild(new HuiLabel('oemurl_label', array('label' => $amp_locale->GetStr('oemurl_label'))), 1, 0);
    $oem_grid->AddChild(new HuiString('oemurl', array('disp' => 'pass', 'size' => '30', 'value' => $mod_cfg->GetKey('oem-url'))), 1, 1);
    // OEM big logo
    //
    $oem_grid->AddChild(new HuiLabel('oembiglogo_label', array('label' => $amp_locale->GetStr('oembiglogo_label'))), 2, 0);
    $oem_grid->AddChild(new HuiFile('oembiglogo', array('disp' => 'pass')), 2, 1);
    // OEM link logo
    //
    $oem_grid->AddChild(new HuiLabel('oemlogo_label', array('label' => $amp_locale->GetStr('oemlogo_label'))), 3, 0);
    $oem_grid->AddChild(new HuiFile('oemlinklogo', array('disp' => 'pass')), 3, 1);
    $oem_vgroup->AddChild($oem_grid);
    $oem_vgroup->AddChild(new HuiSubmit('oemsubmit', array('caption' => $amp_locale->GetStr('oem_submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'setoem', ''));
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $oem_form = new HuiForm('setoemform', array('action' => $form_events_call->GetEventsCallString()));
    $oem_form->AddChild($oem_vgroup);
    // Enabled icons
    //
    $enable_vgroup = new HuiVertGroup('enablevgroup', array('width' => '100%'));
    $enable_vgroup->AddChild(new HuiLabel('enablelabel', array('label' => $amp_locale->GetStr('enabled_icons_label'), 'bold' => 'true')));
    $enable_grid = new HuiGrid('enablegrid', array('rows' => '5', 'cols' => '2'));
    // Ampoliros site link
    //
    $enable_grid->AddChild(new HuiLabel('ampiconlabel', array('label' => $amp_locale->GetStr('amp_link_enabled_label'))), 0, 1);
    $enable_grid->AddChild(new HuiCheckBox('ampicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('ampoliros-link-disabled') ? 'false' : 'true')), 0, 0);
    // Solarix site link
    //
    $enable_grid->AddChild(new HuiLabel('solarixiconlabel', array('label' => $amp_locale->GetStr('solarix_link_enabled_label'))), 1, 1);
    $enable_grid->AddChild(new HuiCheckBox('solarixicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('solarix-link-disabled') ? 'false' : 'true')), 1, 0);
    // OEM link
    //
    $enable_grid->AddChild(new HuiLabel('oemiconlabel', array('label' => $amp_locale->GetStr('oem_link_enabled_label'))), 2, 1);
    $enable_grid->AddChild(new HuiCheckBox('oemicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('oem-link-disabled') ? 'false' : 'true')), 2, 0);
    // Ampoliros big logo
    //
    $enable_grid->AddChild(new HuiLabel('ampbigiconlabel', array('label' => $amp_locale->GetStr('amp_biglogo_enabled_label'))), 3, 1);
    $enable_grid->AddChild(new HuiCheckBox('ampbigicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('ampoliros-biglogo-disabled') ? 'false' : 'true')), 3, 0);
    // OEM logo
    //
    $enable_grid->AddChild(new HuiLabel('oemiconlabel', array('label' => $amp_locale->GetStr('oem_biglogo_enabled_label'))), 4, 1);
    $enable_grid->AddChild(new HuiCheckBox('oembigicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('oem-biglogo-disabled') ? 'false' : 'true')), 4, 0);
    $enable_vgroup->AddChild($enable_grid);
    $enable_vgroup->AddChild(new HuiSubmit('enablesubmit', array('caption' => $amp_locale->GetStr('enable_submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'setenabledicons', ''));
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $enable_form = new HuiForm('setenableform', array('action' => $form_events_call->GetEventsCallString()));
    $enable_form->AddChild($enable_vgroup);
    // Advanced settings
    //
    $advanced_vgroup = new HuiVertGroup('enablevgroup', array('width' => '100%'));
    $advanced_vgroup->AddChild(new HuiLabel('enablelabel', array('label' => $amp_locale->GetStr('advancedsettings_label'), 'bold' => 'true')));
    $advanced_grid = new HuiGrid('enablegrid', array('rows' => '2', 'cols' => '2'));
    // Compressed output buffering
    //
    $advanced_grid->AddChild(new HuiLabel('compressed-ob-label', array('label' => $amp_locale->GetStr('compressed-ob_label'))), 0, 1);
    if (!strlen($compressed_ob)) {
        if (AMP_COMPRESSED_OB) {
            $compressed_ob = 'true';
        } else {
            $compressed_ob = 'false';
        }
    }
    $advanced_grid->AddChild(new HuiCheckBox('compressed-ob', array('disp' => 'pass', 'checked' => $compressed_ob)), 0, 0);
    // HUI code comments
    //
    $advanced_grid->AddChild(new HuiLabel('hui-comments-label', array('label' => $amp_locale->GetStr('hui-comments_label'))), 1, 1);
    if (!strlen($hui_comments)) {
        if (AMP_HUI_COMMENTS) {
            $hui_comments = 'true';
        } else {
            $hui_comments = 'false';
        }
    }
    $advanced_grid->AddChild(new HuiCheckBox('hui-comments', array('disp' => 'pass', 'checked' => $hui_comments)), 1, 0);
    $advanced_vgroup->AddChild($advanced_grid);
    $advanced_vgroup->AddChild(new HuiSubmit('enablesubmit', array('caption' => $amp_locale->GetStr('advanced_submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'setadvanced', ''));
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $advanced_form = new HuiForm('setenableform', array('action' => $form_events_call->GetEventsCallString()));
    $advanced_form->AddChild($advanced_vgroup);
    $tab_headers[0]['label'] = $amp_locale->GetStr('oemframe_label');
    $tab_headers[1]['label'] = $amp_locale->GetStr('enabled_icons_label');
    $tab_headers[2]['label'] = $amp_locale->GetStr('advancedsettings_label');
    $tab = new HuiTab('interface', array('tabactionfunction' => 'interface_tab_action_builder', 'activetab' => isset($eventData['activetab']) ? $eventData['activetab'] : '', 'tabs' => $tab_headers));
    $tab->AddChild($oem_form);
    $tab->AddChild($enable_form);
    $tab->AddChild($advanced_form);
    $hui_mainframe->AddChild($tab);
    $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('default_title');
}