function stage3() { $table = new CTable(null, 'requirements'); $table->setAlign('center'); $DB['TYPE'] = $this->getConfig('DB_TYPE'); $cmbType = new CComboBox('type', $DB['TYPE'], 'this.form.submit();'); $frontendSetup = new FrontendSetup(); $databases = $frontendSetup->getSupportedDatabases(); foreach ($databases as $id => $name) { $cmbType->addItem($id, $name); } $table->addRow(array(new CCol(_('Database type'), 'header'), $cmbType)); switch ($DB['TYPE']) { case ZBX_DB_SQLITE3: $database = new CTextBox('database', $this->getConfig('DB_DATABASE', 'zabbix')); $database->attr('onchange', "disableSetupStepButton('#next_2')"); $table->addRow(array(new CCol(_('Database file'), 'header'), $database)); break; default: $server = new CTextBox('server', $this->getConfig('DB_SERVER', 'localhost')); $server->attr('onchange', "disableSetupStepButton('#next_2')"); $table->addRow(array(new CCol(_('Database host'), 'header'), $server)); $port = new CNumericBox('port', $this->getConfig('DB_PORT', '0'), 5, 'no', false, false); $port->attr('style', ''); $port->attr('onchange', "disableSetupStepButton('#next_2'); validateNumericBox(this, 'false', 'false');"); $table->addRow(array(new CCol(_('Database port'), 'header'), array($port, ' 0 - use default port'))); $database = new CTextBox('database', $this->getConfig('DB_DATABASE', 'zabbix')); $database->attr('onchange', "disableSetupStepButton('#next_2')"); $table->addRow(array(new CCol(_('Database name'), 'header'), $database)); if ($DB['TYPE'] == ZBX_DB_DB2) { $schema = new CTextBox('schema', $this->getConfig('DB_SCHEMA', '')); $schema->attr('onchange', "disableSetupStepButton('#next_2')"); $table->addRow(array(new CCol(_('Database schema'), 'header'), $schema)); } $user = new CTextBox('user', $this->getConfig('DB_USER', 'root')); $user->attr('onchange', "disableSetupStepButton('#next_2')"); $table->addRow(array(new CCol(_('User'), 'header'), $user)); $password = new CPassBox('password', $this->getConfig('DB_PASSWORD', '')); $password->attr('onchange', "disableSetupStepButton('#next_2')"); $table->addRow(array(new CCol(_('Password'), 'header'), $password)); break; } global $ZBX_MESSAGES; if (!empty($ZBX_MESSAGES)) { $lst_error = new CList(null, 'messages'); foreach ($ZBX_MESSAGES as $msg) { $lst_error->addItem($msg['message'], $msg['type']); } $table = array($table, $lst_error); } return array(new CDiv(new CDiv(array('Please create database manually, and set the configuration parameters for connection to this database.', BR(), BR(), 'Press "Test connection" button when done.', BR(), $table), 'vertical_center'), 'table_wraper'), new CDiv(array(isset($_REQUEST['retry']) ? !$this->DISABLE_NEXT_BUTTON ? new CSpan(array(_('OK'), BR()), 'ok') : new CSpan(array(_('Fail'), BR()), 'fail') : null, new CSubmit('retry', 'Test connection')), 'info_bar')); }
} include_once 'include/page_header.php'; if (isset($_REQUEST['message'])) { show_error_message($_REQUEST['message']); } if (!isset($sessionid) || $USER_DETAILS['alias'] == ZBX_GUEST_USER) { switch ($authentication_type) { case ZBX_AUTH_HTTP: break; case ZBX_AUTH_LDAP: case ZBX_AUTH_INTERNAL: default: // konqueror bug #138024; adding useless param(login=1) to the form's action path to avoid bug!! $frmLogin = new CFormTable(S_LOGIN, 'index.php?login=1', 'post', 'multipart/form-data'); $frmLogin->setHelp('web.index.login'); $frmLogin->addVar('request', $request); $lt = new CTextBox('name'); $lt->addStyle('width: 150px'); $frmLogin->addRow(S_LOGIN_NAME, $lt); $pt = new CPassBox('password'); $pt->addStyle('width: 150px'); $frmLogin->addRow(S_PASSWORD, $pt); $frmLogin->addItemToBottomRow(new CButton('enter', 'Enter')); $frmLogin->show(false); setFocus($frmLogin->getName(), 'name'); $frmLogin->destroy(); } } else { echo '<div align="center" class="textcolorstyles">' . S_WELCOME . ' <b>' . $USER_DETAILS['alias'] . '</b>.</div>'; } include_once 'include/page_footer.php';
} $mediaTypeFormList->addRow(_('Type'), $cmbTypeRow); // append others fields to form list if ($this->data['type'] == MEDIA_TYPE_EMAIL) { $mediaTypeFormList->addRow(_('SMTP server'), new CTextBox('smtp_server', $this->data['smtp_server'], ZBX_TEXTBOX_STANDARD_SIZE)); $mediaTypeFormList->addRow(_('SMTP helo'), new CTextBox('smtp_helo', $this->data['smtp_helo'], ZBX_TEXTBOX_STANDARD_SIZE)); $mediaTypeFormList->addRow(_('SMTP email'), new CTextBox('smtp_email', $this->data['smtp_email'], ZBX_TEXTBOX_STANDARD_SIZE)); } elseif ($this->data['type'] == MEDIA_TYPE_SMS) { $mediaTypeFormList->addRow(_('GSM modem'), new CTextBox('gsm_modem', $this->data['gsm_modem'], ZBX_TEXTBOX_STANDARD_SIZE)); } elseif ($this->data['type'] == MEDIA_TYPE_EXEC) { $mediaTypeFormList->addRow(_('Script name'), new CTextBox('exec_path', $this->data['exec_path'], ZBX_TEXTBOX_STANDARD_SIZE)); } elseif ($this->data['type'] == MEDIA_TYPE_JABBER || $this->data['type'] == MEDIA_TYPE_EZ_TEXTING) { // create password field if (!empty($this->data['password'])) { $passwordButton = new CButton('chPass_btn', _('Change password'), 'this.style.display="none"; $("password").enable().show().focus();'); $passwordBox = new CPassBox('password', $this->data['password'], ZBX_TEXTBOX_SMALL_SIZE); $passwordBox->addStyle('display: none;'); $passwordField = array($passwordButton, $passwordBox); } else { $passwordField = new CPassBox('password', '', ZBX_TEXTBOX_SMALL_SIZE); } // append password field to form list if ($this->data['type'] == MEDIA_TYPE_JABBER) { $mediaTypeFormList->addRow(_('Jabber identifier'), new CTextBox('username', $this->data['username'], ZBX_TEXTBOX_STANDARD_SIZE)); $mediaTypeFormList->addRow(_('Password'), $passwordField); } else { $mediaTypeFormList->addRow(_('Username'), new CTextBox('username', $this->data['username'], ZBX_TEXTBOX_STANDARD_SIZE)); $mediaTypeFormList->addRow(_('Password'), $passwordField); $limitCb = new CComboBox('exec_path', $this->data['exec_path']); $limitCb->addItems(array(EZ_TEXTING_LIMIT_USA => _('USA (160 characters)'), EZ_TEXTING_LIMIT_CANADA => _('Canada (136 characters)'))); $mediaTypeFormList->addRow(_('Message text limit'), $limitCb);
$frmMedia->addRow(S_TYPE, $row); if ($type == MEDIA_TYPE_EMAIL) { $frmMedia->addRow(S_SMTP_SERVER, new CTextBox('smtp_server', $smtp_server, 30)); $frmMedia->addRow(S_SMTP_HELO, new CTextBox('smtp_helo', $smtp_helo, 30)); $frmMedia->addRow(S_SMTP_EMAIL, new CTextBox('smtp_email', $smtp_email, 30)); } else { if ($type == MEDIA_TYPE_SMS) { $frmMedia->addRow(S_GSM_MODEM, new CTextBox('gsm_modem', $gsm_modem, 50)); } else { if ($type == MEDIA_TYPE_EXEC) { $frmMedia->addRow(S_SCRIPT_NAME, new CTextBox('exec_path', $exec_path, 50)); } else { if ($type == MEDIA_TYPE_JABBER || $type == MEDIA_TYPE_EZ_TEXTING) { if (isset($_REQUEST['mediatypeid']) && !empty($password)) { $chPass_btn = new CButton('chPass_btn', S_CHANGE_PASSWORD, 'this.style.display="none"; $("password").enable().show().focus();', false); $pass_txt = new CPassBox('password', '', 30); $pass_txt->setAttribute('disabled', 'disabled'); $pass_txt->addStyle('display: none;'); $pass_fields = array($chPass_btn, $pass_txt); } else { $pass_fields = new CPassBox('password', '', 30); } if ($type == MEDIA_TYPE_JABBER) { $frmMedia->addRow(S_JABBER_IDENTIFIER, new CTextBox('username', $username, 30)); $frmMedia->addRow(S_PASSWORD, $pass_fields); } else { $frmMedia->addRow(S_USERNAME, new CTextBox('username', $username, 30)); $frmMedia->addRow(S_PASSWORD, $pass_fields); $limit_cb = new CComboBox('exec_path', $exec_path); $limit_cb->addItems(array(EZ_TEXTING_LIMIT_USA => S_EZ_TEXTING_USA, EZ_TEXTING_LIMIT_CANADA => S_EZ_TEXTING_CANADA)); $frmMedia->addRow(S_MESSAGE_TEXT_LIMIT, $limit_cb);