Ejemplo n.º 1
0
					if($config['show_database_error_messages'])
						$page->ErrorDatabaseBox($dbase->GetDatabaseError());
				}
				
				// If how ever the step IS set to 1 and the connection to database has been 
				// successful, let user know he does not have to set the values again or change them
				else if($step == STEP_DBCONNECT && $dbase->IsConnected())
				{
					$page->SuccessBox('Connection to database server is successful with login '. 
						'provided. Proceed to the next step');
				} 
				
				// If the port is optional and the port value contains 
				// non-digits then display warning message
				if($steps[STEP_DBCONNECT]['portoptional'] && !$dbase->IsConnected()
					&& strlen($login['dbport']) > 0 && !IsNumericOnly($login['dbport']))
				{
					$page->WarningBox('The port value <b>'.$login['dbport'].'</b> is not a valid numeric value'); 
				}

				// If the password is encrypted and connection has been made successfully - then pressing NEXT
				// in the 'else' clause below would send an empty string and reset the password to nothing. So,
				// either force the user to type in the password every time he visists this step (which sucks)
				// or just show success message and offer a "disconnect" button instead. Then the only info posted
				// on the "next" button here will be the step key
				if($steps[STEP_DBCONNECT]['encryptlogin'] && $dbase->IsConnected())
				{
					$page->FormStart(array('step'=>GetNextStep(STEP_DBCONNECT)));
					$prev = GetPrevStep(STEP_DBCONNECT);
					if($prev) $page->FormButton('Back', array('step'=>$prev));    
					$page->FormSubmit('Next');
Ejemplo n.º 2
0
 $page->MainTitle($steps[STEP_DBCONNECT]['title'], 'connection');
 // If the step is not STEP_DBCONNECT, then the installer was going
 // somewhere else - so error message should be displayed
 if ($step != STEP_DBCONNECT) {
     $page->WarningBox('Unable to establish a connection to <b>' . $login['hostname'] . '</b>. ' . 'Please fill in <i>hostname</i>, <i>username</i> and <i>password</i>.');
     if ($config['show_database_error_messages']) {
         $page->ErrorDatabaseBox($dbase->GetDatabaseError());
     }
 } else {
     if ($step == STEP_DBCONNECT && $dbase->IsConnected()) {
         $page->SuccessBox('Connection to database server is successful with login ' . 'provided. Proceed to the next step');
     }
 }
 // If the port is optional and the port value contains
 // non-digits then display warning message
 if ($steps[STEP_DBCONNECT]['portoptional'] && !$dbase->IsConnected() && strlen($login['dbport']) > 0 && !IsNumericOnly($login['dbport'])) {
     $page->WarningBox('The port value <b>' . $login['dbport'] . '</b> is not a valid numeric value');
 }
 // If the password is encrypted and connection has been made successfully - then pressing NEXT
 // in the 'else' clause below would send an empty string and reset the password to nothing. So,
 // either force the user to type in the password every time he visists this step (which sucks)
 // or just show success message and offer a "disconnect" button instead. Then the only info posted
 // on the "next" button here will be the step key
 if ($steps[STEP_DBCONNECT]['encryptlogin'] && $dbase->IsConnected()) {
     $page->FormStart(array('step' => GetNextStep(STEP_DBCONNECT)));
     $prev = GetPrevStep(STEP_DBCONNECT);
     if ($prev) {
         $page->FormButton('Back', array('step' => $prev));
     }
     $page->FormSubmit('Next');
     $page->FormClose();
Ejemplo n.º 3
0
	function GetSettingsValue($value)
	{
		$show = '';
		if(is_array($value))
		{
			if(count($value) == 0)
				$show = '<i style="color:#9A9A9A;">*empty*</i>';
			else
			{
				foreach($value as $idx=>$item)
				{
					if(IsNumericOnly($idx))
						 $show .= $item.', ';
					else $show .= '['.$idx.']='.$item.', ';
				}
				$show = substr($show, 0, strlen($show)-2);
			}
		}
		else
		{
			if($value === true)
				 $show = GetAsBlue('TRUE');
			else if($value === false)
				$show = GetAsOrange('FALSE');
			else
				$show = htmlentities($value);
		}

		return $show;
	}