コード例 #1
0
ファイル: loader-wizard.php プロジェクト: NeformatDev/v2
function run()
{
    unregister_globals();
    ini_set('session.cache_expire', 1);
    if (is_php_version_or_greater(4, 3, 0)) {
        ini_set('session.use_only_cookies', 1);
    }
    ini_set('session.cookie_lifetime', 1);
    @session_start();
    if (!isset($_SESSION['CREATED'])) {
        $_SESSION['CREATED'] = time();
    } elseif (time() - $_SESSION['CREATED'] > SESSION_LIFETIME_MINUTES * 60) {
        session_destroy();
        $_SESSION = array();
    }
    if (!isset($_SERVER)) {
        $_SERVER =& $HTTP_SERVER_VARS;
    }
    php_sapi_name() == 'cli' && die("This script should only be run by a web server.\n");
    $page = get_request_parameter('page');
    $host = get_request_parameter('host');
    $clear = get_request_parameter('clear');
    if (!empty($host)) {
        if ($host == 'ngd') {
            $_SESSION['not_go_daddy'] = 1;
        }
    }
    if (!empty($clear)) {
        unset($_SESSION['not_go_daddy']);
        unset($_SESSION['latest_version']);
        unset($_SESSION['loader_platform_info']);
        unset($_SESSION['loader_version_info']);
        unset($_SESSION['php_compilers_info']);
    }
    if (!array_key_exists('latest_version', $_SESSION) || !isset($_SESSION['latest_version']) || $_SESSION['latest_version'] === false) {
        $_SESSION['latest_version'] = retrieve_latest_version();
    }
    if (!empty($page)) {
        $fn = "{$page}_page";
        if (function_exists($fn)) {
            $fn();
        } else {
            default_page();
        }
    } else {
        $godaddy_root = GoDaddy_root();
        if (empty($godaddy_root)) {
            default_page();
        } else {
            GoDaddy_page($godaddy_root);
        }
    }
    @session_write_close();
    exit(0);
}
コード例 #2
0
ファイル: index.php プロジェクト: Russell-IO/php-syslog-ng
function run()
{
    unregister_globals();
    if (is_php_version_or_greater(4,3,0)) {
        ini_set('session.use_only_cookies',1);
    }
    @session_start();
    if (!isset($_SESSION['CREATED'])) {
        $_SESSION['CREATED'] = time();
    } elseif (time() - $_SESSION['CREATED'] > SESSION_LIFETIME_MINUTES * 60) {
        $persist['not_go_daddy'] = empty($_SESSION['not_go_daddy'])?0:1;
        $persist['use_ini_method'] = empty($_SESSION['use_ini_method'])?0:1;
        $persist['server_type'] = empty($_SESSION['server_type'])?SERVER_UNKNOWN:$_SESSION['server_type'];
        session_destroy();
        $_SESSION = array();
        $_SESSION = $persist;
    }
    
    if (!isset($_SERVER)) $_SERVER =& $HTTP_SERVER_VARS;

    (php_sapi_name() == 'cli') && die("This script should only be run by a web server.\n");

    $page = get_request_parameter('page');
    $host = get_request_parameter('host');
    $clear = get_request_parameter('clear');
    $ini = get_request_parameter('ini');

    if (!empty($host)) {
        if ($host == 'ngd') {
            $_SESSION['not_go_daddy'] = 1;
        }
    }
    if (!empty($ini)) {
        $_SESSION['use_ini_method'] = 1;
    }

    if (!empty($clear)) {
        unset($_SESSION['latest_version']);
        unset($_SESSION['loader_platform_info']);
        unset($_SESSION['loader_version_info']);
        unset($_SESSION['php_compilers_info']);
        unset($_SESSION['not_go_daddy']);
        unset($_SESSION['use_ini_method']);
        unset($_SESSION['server_type']);
    }

    if (empty($_SESSION['latest_version'])) {
        $_SESSION['latest_version'] = retrieve_latest_version();
    }

    if (empty($_SESSION['server_type'])) {
        $_SESSION['server_type'] = SERVER_UNKNOWN;
    }

    if (!empty($page)) {
        $fn = "${page}_page";
        if (function_exists($fn)) {
            $fn();
        } else {
            default_page();
        }
    } else {
        $godaddy_root = GoDaddy_root();
        if (empty($godaddy_root)) {
            default_page();
        } else {
            GoDaddy_page($godaddy_root);
        }
    }
    @session_write_close();
    exit(0);
}
コード例 #3
0
                default_page($result->getMessage());
            } elseif ($result === null) {
                default_page('The Homesite denied verification');
            } else {
                success_page();
            }
            break;
        case 'info':
            phpinfo();
            break;
        default:
            default_page();
            break;
    }
} else {
    default_page();
}
function default_page($error = '')
{
    global $script_url, $sxip_properties;
    if (isset($_POST['dix:/homesite'])) {
        $homesite = $_POST['dix:/homesite'];
    } elseif (isset($_COOKIE['dix:/homesite'])) {
        $homesite = $_COOKIE['dix:/homesite'];
    } else {
        $homesite = '';
    }
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
コード例 #4
0
ファイル: functions.inc.php プロジェクト: druus/oscar
function search_form($db)
{
    // Allow user to search only via asset number
    default_page($db);
    print "<p>And here some other search criterias can be entered...</p>\n";
    // Allow searching by category/categories
    ?>
<form method="POST" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
">
<input type="hidden" name="cmd" value="search_criteria">
<table>
<tr>
	<!-- Search on category -->
	<td>
	Select category<br/>
<?php 
    // Retreive list of categories, present in a multiple-select list
    $selCategory = "SELECT id, category FROM category WHERE active='Yes' ORDER BY category";
    $db->setsql($selCategory);
    $resCategory = $db->selectquery();
    if (!$resCategory) {
        print_error("Unable to retreive list of categories!<br/>Database error message: " . mysql_error(), "error");
    } else {
        if ($db->numberrows == 0) {
            print "No categories found\n";
        } else {
            ?>
		<select name="search_category[]" class="input-style" multiple="true" size="8">
<?php 
            for ($loop = 0; $loop < $db->numberrows; $loop++) {
                print "\t\t\t<option value=\"" . $db->result[$loop]['id'] . "\">" . $db->result[$loop]['category'] . "</option>\n";
            }
            ?>

		</select>
		
<?php 
        }
    }
    ?>
	</td>
	<!-- Search on department -->
	<td>
	Select department<br/>
<?php 
    // Retreive list of departments, present in a multiple-select list
    $selDepartment = "SELECT dep_id, dep_name FROM aq_department WHERE active='Yes' ORDER BY dep_name";
    $db->setsql($selDepartment);
    $resDepartment = $db->selectquery();
    if (!$resDepartment) {
        print_error("Unable to retreive list of departments!<br/>Database error message: " . mysql_error(), "error");
    } else {
        if ($db->numberrows == 0) {
            print "No departments found\n";
        } else {
            ?>
		<select name="search_department[]" class="input-style" multiple="true" size="8">
<?php 
            for ($loop = 0; $loop < $db->numberrows; $loop++) {
                print "\t\t\t<option value=\"" . $db->result[$loop]['dep_id'] . "\">" . $db->result[$loop]['dep_name'] . "</option>\n";
            }
            ?>

		</select>
		
<?php 
        }
    }
    ?>
	</td>
	<!-- Search on owner -->
	<td>
	Select asset owner/client<br/>
<?php 
    // Retreive list of owners (clients), present in a multiple-select list
    $selOwner = "SELECT cid, client FROM clients WHERE active='Yes' ORDER BY client";
    $db->setsql($selOwner);
    $resOwner = $db->selectquery();
    if (!$resOwner) {
        print_error("Unable to retreive list of clients!<br/>Database error message: " . mysql_error(), "error");
    } else {
        if ($db->numberrows == 0) {
            print "No clients found\n";
        } else {
            ?>
		<select name="search_client[]" class="input-style" multiple="true" size="8">
<?php 
            for ($loop = 0; $loop < $db->numberrows; $loop++) {
                print "\t\t\t<option value=\"" . $db->result[$loop]['cid'] . "\">" . $db->result[$loop]['client'] . "</option>\n";
            }
            ?>

		</select>
		
<?php 
        }
    }
    ?>
	</td>

    <!-- Search on manufacturer -->
    <td>
    Select manufacturer
<?php 
    // Retreive list of owners (clients), present in a multiple-select list
    $selManuf = "SELECT DISTINCT(manufacturer) FROM asset ORDER BY manufacturer";
    $db->setsql($selManuf);
    $resManuf = $db->selectquery();
    if (!$resManuf) {
        print_error("Unable to retreive list of manufacturers!<br/>Database error message: " . mysql_error(), "error");
    } else {
        if ($db->numberrows == 0) {
            print "<br/>No manufacturers found\n";
        } else {
            echo " (Found " . $db->numberrows . " unique entries)<br/>\n";
            ?>
		<select name="search_manuf[]" class="input-style" multiple="true" size="8">
<?php 
            for ($loop = 0; $loop < $db->numberrows; $loop++) {
                print "\t\t\t<option value=\"" . $db->result[$loop]['manufacturer'] . "\">" . $db->result[$loop]['manufacturer'] . "</option>\n";
            }
            ?>

		</select>
		
<?php 
        }
    }
    ?>

    </td>
</tr>
<tr>
	<td colspan="3">
	Enter additional search text:&nbsp;
	<input type="text" name="search_text" class="input-style" size="40">
	</td>
<tr>
	<td colspan="2" align="center"><input type="submit" value="Search"></td>
</tr>
</form>
</table>
<?php 
}