/** * --- Update bundles --- * Updates the hosters current amount of bundles the overriding the existing list with * the bundles returned by the nimbusec API */ function updateBundles() { // -- Retrieves crednetials -- $credentials = getCredentials(); $packageExt = new PackageExtensions($credentials['key'], $credentials['secret']); $packageExt->updatePackageExtensions(); }
function getConnection() { // Create connection $connInfo = getCredentials(); $conn = new mysqli($connInfo['servername'], $connInfo['username'], $connInfo['password']); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } //echo "Connected successfully"; $db_selected = $conn->query("USE RSS"); if (!$db_selected) { die('Can\'t use RSS : ' . mysql_error()); } return $conn; }
?> " method="POST"> Audit Mode:<select name="mode"> <option value="Deployment">Deployment</option> <option value="Development">Development</option> </select> <input type="submit" name="audit" value="Run Configuration Audit"> </form> <br /> <?php $num_directives = 0; if (isset($_POST['audit'])) { $mode = $_POST['mode']; getCredentials(); connecter($host, $user, $passwd); $directives = mysql_query("SELECT * FROM phpdirectives") or die("Unable to fetch PHP directives:" . mysql_error()); if ($directives) { $PHP_directive_objects = array(); $num_directives = mysql_num_rows($directives); for ($i = 0; $i < $num_directives; $i++) { $PHP_directive_Objects[$i] = new PHPDirective(); $PHP_directive_Objects[$i]->setDirectiveName(mysql_result($directives, $i, 'directivename')); $PHP_directive_Objects[$i]->setRecommendedValue(mysql_result($directives, $i, 'recomendedvalue')); $PHP_directive_Objects[$i]->setCurrentValue($PHP_directive_Objects[$i]->getCurrentValue($PHP_directive_Objects[$i]->getDirectiveName(), $phpini_path)); $PHP_directive_Objects[$i]->setDescription(mysql_result($directives, $i, 'description')); $PHP_directive_Objects[$i]->setRemark(mysql_result($directives, $i, 'remark')); $PHP_directive_Objects[$i]->setPossibleValues("this is an array that comes from values table per each directive"); } }
// main.core require_once 'inc/main.core.php'; } // authenticate if (isAuthenticated() == 1) { // check if we are locked if ($cfg["webapp_locked"] == 1) { // only superadmin can login when we are locked if (!IsSuperAdmin()) { @header('location: locked.php'); exit; } } } else { // try to auth with supplied credentials $credentials = getCredentials(); if ($credentials !== false) { if (performAuthentication($credentials['username'], $credentials['password'], $credentials['md5pass']) == 1) { if (isAuthenticated() != 1) { @header('location: login.php'); exit; } $currentUser = $cfg["user"]; // check if we are locked if ($cfg["webapp_locked"] == 1) { // only superadmin can login when we are locked if (!IsSuperAdmin()) { @header('location: locked.php'); exit; } }
#!/usr/bin/php <?php /******************************************************************************* * $Id: freelancer_tests.php 727 2010-05-05 11:57:51Z ndejong $ * Copyright: Nicholas de Jong (me -at- nicholasdejong.com) * Web: http://www.nicholasdejong.com * License: GPLv3 & Commercial Use ******************************************************************************/ include_once 'freelancer.php'; // Set the Freelancer API credentials $credential = getCredentials($argv); $freelancer = new Freelancer($credential['key'], $credential['secret']); // We must first make sure we are authorized before we can make any Freelancer API call $token = $freelancer->authorize(); echo 'Using authorized token: ' . $token . "\n"; // getUsersBySearch //$data_getUsersBySearch = $freelancer->getUsersBySearch(array('country_csv'=>'Australia')); //print_r($data_getUsersBySearch); // getUserFeedbacks //$data_getUserFeedbacks = $freelancer->getUserFeedbacks(array('username'=>$data_getUsersBySearch['items'][0]['username'])); //print_r($data_getUserFeedbacks); // getUserDetails //$data_getUserDetails = $freelancer->getUserDetails(array('username'=>$data_getUsersBySearch['items'][0]['username'])); //print_r($data_getUserDetails); // getJobList //$data_getJobList = $freelancer->getJobList(); //print_r($data_getJobList); // getAccountDetails $data_getAccountDetails = $freelancer->getAccountDetails(); print_r($data_getAccountDetails); // getProfileInfo
$_SESSION['eticookie'] = $cookies; } if (is_local()) { $_SESSION['eticookie'] = 'asdf'; $valid = true; } //close connection curl_close($ch); return $valid; } //ETI validation session_start(); if (!isset($_SESSION['eticookie'])) { $loggedIn = false; if (isset($_POST['username']) && isset($_POST['password'])) { $valid = getCredentials($_POST['username'], $_POST['password']); if ($valid) { $_SESSION['username'] = $username = $_POST['username']; $loggedIn = true; } else { $errors[] = 1; /* error codes: 1 = not logged in on ETI */ } } } else { //inefficient login check. todo: redirect to login page on topics.php/messages.php failure instead of this $loggedIn = strpos(HTTP_Get('http://boards.endoftheinter.net/topics/LUE', $_SESSION['eticookie']), 'LUE'); $username = $_SESSION['username']; } /* functions */ function plural($var)
session_start(); header('Content-Type: text/html; charset=utf-8'); global $CLIENT_ID, $CLIENT_SECRET, $REDIRECT_URI; $client = new Google_Client(); $client->setClientId($CLIENT_ID); $client->setClientSecret($CLIENT_SECRET); $client->setRedirectUri($REDIRECT_URI); $client->setScopes('email'); $authUrl = $client->createAuthUrl(); if (isset($_GET['code'])) { getCredentials($_GET['code'], $authUrl); //add code to a session variable $_SESSION['auth_code'] = $_GET['code']; } else { if (isset($_SESSION['auth_code'])) { getCredentials($_SESSION['auth_code'], $authUrl); } else { echo 'Unnown Error Occured'; } } $userName = $_SESSION["userInfo"]["name"]; $userEmail = $_SESSION["userInfo"]["email"]; ?> <!DOCTYPE html> <html lang="fi"> <head> <title>Logged in</title> <meta charset="UTF-8"> </head> <body>
<?php require_once "functions.php"; session_start(); header('Content-Type: text/html; charset=utf-8'); global $CLIENT_ID, $CLIENT_SECRET, $REDIRECT_URI; $client = new Google_Client(); $client->setClientId($CLIENT_ID); $client->setClientSecret($CLIENT_SECRET); $client->setRedirectUri($REDIRECT_URI); $client->setScopes('email'); $authUrl = $client->createAuthUrl(); getCredentials($_GET['code'], $authUrl); $userName = $_SESSION["userInfo"]["name"]; $userEmail = $_SESSION["userInfo"]["email"]; ?> <!DOCTYPE html> <html lang="fi"> <head> <title>Logged in</title> <meta charset="UTF-8"> </head> <body> Hello <?php echo $userName; ?> ! <br> <?php echo $userEmail;
<?php require 'SabreDAV/vendor/autoload.php'; require 'credentials.php'; use Sabre\DAV\Client; // Parameters $serie = $_GET["s"]; $chapter = str_pad($_GET["c"], 4, "0", STR_PAD_LEFT); $nextPage = str_pad(intval($_GET["p"]) + 1, 2, "0", STR_PAD_LEFT); // Complete filename $filename = '/' . $serie . '/' . $chapter . '/' . $chapter . '-' . $nextPage . '.jpg'; // Set credentials $settings = getCredentials($serie, $chapter); $client = new Client($settings); $response = $client->request('GET', $filename); $statusCode = $response["statusCode"]; if ($statusCode != 200) { // We try the next chapter $chapter = intval($chapter) + 1; $nextPage = 1; } $url = 'read.php?s=' . $serie . '&c=' . intval($chapter) . '&p=' . intval($nextPage); echo $url;