<?php

require "settings.php";
require "core-settings.php";
error_reporting(E_ALL);
// Navigation logic
if (isset($_REQUEST["button"])) {
    list($button) = array_keys($_REQUEST["button"]);
    switch ($button) {
        case "complete":
            $OUTPUT = complete();
            break;
        case "page_complete":
            $OUTPUT = page_complete();
            break;
    }
} elseif (isset($_REQUEST["key"])) {
    switch ($_REQUEST["key"]) {
        case "adjust_display":
            $OUTPUT = adjust_display();
            break;
        case "adjust_update":
            $OUTPUT = adjust_update();
            break;
    }
} else {
    $OUTPUT = adjust_display();
}
// Quick links
$OUTPUT .= mkQuicklinks(ql("stock-add.php", "Add Stock"), ql("stock-view.php", "View Stock"));
require "template.php";
Example #2
0
<?php

session_start();
define(ROOT, $_SERVER['DOCUMENT_ROOT']);
include_once ROOT . "/functions/database_management.php";
//TODO: Reemplazar por $_SESSION['username']
switch ($_POST["functionCalled"]) {
    case "hasCompleted":
        echo 'ret=' . var_export(hasCompleted($_POST["eventName"], $_POST["username"], $_POST["puzzle"]), true);
        break;
    case "complete":
        echo complete($_POST["eventName"], $_POST["username"], $_POST["puzzle"]);
        break;
    case "isAvailable":
        echo 'ret=' . var_export(isAvailable($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
        break;
    case "hasObject":
        echo 'ret=' . var_export(hasObject($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
        break;
    case "usedObject":
        echo 'ret=' . var_export(usedObject($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
        break;
    case "releaseObject":
        releaseObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
        break;
    case "getObject":
        getObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
        break;
    case "useObject":
        useObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
        break;
Example #3
0
		if($nextQuestion)
		{
			if(array_key_exists('say', $nextQuestion))
			{
				$tropo[] = array(
					'say' => array(
						'value' => $nextQuestion['say']
					),
					'voice' => $voice
				);
				$nextQuestion = $questions[$nextQuestionIndex + 1];
			}
			askQuestion($nextQuestion);
		}
		else
			complete();
	}
	else
	{
		askQuestion($thisQuestion, TRUE);
	}
}
else
{
	$tropo[] = array(
		'say' => array('value'=>'Sorry, there was an error. Goodbye.'),
		'voice' => $voice
	);
	sendCurrentCall();
}
Example #4
0
function prev_month($bulan, $tahun)
{
    if ($bulan > 1) {
        return '/' . $tahun . '/' . complete($bulan - 1, 2);
    } else {
        return '/' . ($tahun - 1) . '/12';
    }
}
if (isset($_POST['partial'])) {
    $secret = get_option('wordpress-console-secret');
    if (!$secret) {
        return;
    }
    if (!isset($_POST['signature']) || !$_POST['signature']) {
        return;
    }
    $partial = stripslashes($_POST['partial']);
    if (hash_hmac('sha1', $partial, $secret) != $_POST['signature']) {
        return;
    }
    if (!preg_match('#([0-9a-z_-]+)$#i', $partial, $m)) {
        die(json_encode(false));
    }
    $candidates = preg_grep("/^{$m[1]}/", complete($m[1]));
    sort($candidates);
    die(json_encode((array) $candidates));
} else {
    error('Error initializing session.');
}
// returns array of possible matches
function complete($string)
{
    /**
     * parse the line-buffer backwards to see if we have a
     * - constant
     * - function
     * - variable
     */
    $m = array();
Example #6
0
function start_admin()
{
    if (!isset($_POST['submit'])) {
        echo "\n\t\t\t<form method='post' action=''>\n\t\t\t\t<table width='100%' class='forum' cellspacing='0' cellpadding='0'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='category' colspan='2'><div class='cat_title'>Create Administrator</div></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='small_title' colspan='2'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='rows' valign='top' width='30%'>Admin name</td>\n\t\t\t\t\t\t<td class='rows' valign='top' width='70%'><input type='text' name='username' /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='rows' valign='top' width='30%'>Password</td>\n\t\t\t\t\t\t<td class='rows' valign='top' width='70%'><input type='password' name='pass' /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='rows' valign='top' width='30%'>Password Again</td>\n\t\t\t\t\t\t<td class='rows' valign='top' width='70%'><input type='password' name='pass2' /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='rows' valign='top' width='30%'>Email</td>\n\t\t\t\t\t\t<td class='rows' valign='top' width='70%'><input type='text' name='Email' /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='rows' valign='top' width='30%'>Website[Must be: <em>http://ursite.com/</em>]</td>\n\t\t\t\t\t\t<td class='rows' valign='top' width='70%'><input type='text' name='site' /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='rows' valign='top' colspan='2' align='center'><input type='submit' name='submit' value='Create Admin Account' /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t\t";
    } else {
        if (!empty($_POST['username']) and !empty($_POST['pass']) and !empty($_POST['Email']) and !empty($_POST['site'])) {
            $email = htmlspecialchars($_POST['Email']);
            $username = htmlspecialchars($_POST['username']);
            $WEBSITE = htmlspecialchars($_POST['site']);
            if ($_POST['pass'] != $_POST['pass2']) {
                echo error("Sorry, these passwords do not match, please go back to fix this problem.");
            } else {
                $joined = time();
                $level = 1;
                $salt = substr(md5(rand(0, 6000)), 0, 10);
                $password = htmlspecialchars(md5($salt . $_POST['pass']));
                if (mysql_query("INSERT INTO `users` (`username`,`email`,`password`,`salt`,`joined`,`level`) VALUES('" . $username . "','" . $email . "','" . $password . "','" . $salt . "','" . $joined . "','" . $level . "') ")) {
                    echo complete("Administrator account was created, you can now visit your site located: <a href='index.php'>Here</a>; Make sure you delete installer.php and install_temp.php from database else you can be at complete danger");
                    session_destroy();
                } else {
                    echo error("Sorry, there was a problem inserting administrator into database, contact Nevux Ability Boards Support tech.");
                }
            }
        } else {
            echo error("Sorry, you left a field blank please go back to finish completion of forum installation.");
        }
    }
}
Example #7
0
/**
 * Lấy nội dung tin để đăng bài
 */
function get_post_entry()
{
    global $links, $links_used, $count_get, $urlpath, $showlog;
    $link = $links[$count_get];
    if (file_exists($urlpath)) {
        $links_used = explode("\n", file_get_contents($urlpath));
    } else {
        file_put_contents($urlpath, '');
    }
    if (trim(file_get_contents('url.txt')) === '' || !is_numeric(array_search($link, $links_used))) {
        if ($showlog) {
            echo '<p style="color: green">' . $count_get . ' | ' . date('h:i:s') . ' | ' . $link . '</p>';
        }
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $link);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $result = curl_exec($ch);
        curl_close($ch);
        libxml_use_internal_errors(true);
        $dom = new DOMDocument();
        $dom->loadHTML($result);
        $title = $dom->getElementsByTagName('h1');
        $excerpt = getElementByClass($dom, 'news-content-excerpt');
        $content = getElementByClass($dom, 'content-post');
        $title = $title->item(0)->textContent;
        $excerpt = $excerpt->item(0)->textContent;
        $content = $dom->saveHTML($content->item(0));
        $bbcode = '[b]' . $excerpt . '[/b]' . "\n\n" . html2bbcode($content);
        if ($showlog) {
            echo '<h2>' . $title . '</h2>';
        }
        if ($showlog) {
            echo '<textarea style="width: 98%; height: 200px;">' . $bbcode . '</textarea>';
        }
        post($title, $bbcode);
        sleep(10);
        $count_get += 1;
        array_push($links_used, $link);
        file_put_contents($urlpath, implode("\n", $links_used));
        if ($count_get < count($links)) {
            if ($showlog) {
                echo '<p>Waiting...</p>';
            }
            get_post_entry();
        } else {
            complete();
        }
    } else {
        if ($showlog) {
            echo '<p style="color: red">' . $count_get . ' | ' . date('h:i:s') . ' | ' . $link . '</p>';
        }
        $count_get += 1;
        if ($count_get < count($links)) {
            get_post_entry();
        } else {
            complete();
        }
    }
}
Example #8
0
                $params["width"] = $imageSize[0];
                if (strpos($thumb, "crop") != false) {
                    $params['crop'] = 1;
                    if (strpos($thumb, "--") == false) {
                        $params["height"] = $imageSize[1];
                    }
                }
                $params[WatermarkSupport::FORCE_TRANSFORM] = true;
                $params[WatermarkSupport::ADD_WATERMARK] = true;
                if ($removeWatermarks == true) {
                    $params[WatermarkSupport::ADD_WATERMARK] = false;
                }
                if ($dryRun == true) {
                    continue;
                }
                $result = $imageFile->getHandler()->doTransform($imageFile, $thumbPath, $thumbUrl, $params, $flags);
                if (get_class($result) == MediaTransformError) {
                    echo "there was an error processing this file \n";
                    echo $result->toText();
                    complete($time, $processedCount);
                }
            }
        }
    }
    if ($dryRun == true) {
        continue;
    }
    updateVersion($version, $articleId, $fname);
}
complete($time, $processedCount);