Exemple #1
0
function checkdbsettings()
{
    global $app, $testcount;
    echoln("Testing mysql connectivity: ");
    $res1 = testconnectusing($app->conf['mysqlrootuser'], $app->conf['mysqlrootpass'], 'mysql');
    if (!$res1) {
        echolnred('Test ' . $testcount . ' failed. Probably your mysqlroot pass is not correct, defined in mysqlrootpass variable. This will not affect normal behaviour of ehcp except you will not be able to create mysql dbs in ehcp.');
    }
    $testcount++;
    $res2 = testconnectusing($app->conf['mysqlrootuser'], $app->conf['mysqlrootpass'], 'ehcp');
    if (!$res2) {
        echolnred('Test ' . $testcount . ' failed. either your mysqlrootpass is not correct or ehcp db does not exist.  ');
    }
    $testcount++;
    $res3 = testconnectusing($app->dbusername, $app->dbpass, 'ehcp');
    if (!$res3) {
        echolnred('<b>Test ' . $testcount . ' failed. your dbusername and/or dbuserpass is not correct. check your db settings.<br> if you just installed ehcp, learn your/know your mysql root pass, then re-install ehcp..<br><a href=http://www.ehcp.net/?q=node/160>mysql password recovery</a></b>');
    }
    $testcount++;
    $res4 = testmysqlconnect('localhost', $app->conf['mysqlrootuser'], $app->conf['mysqlrootpass']);
    if (!$res4) {
        echolnred('Test ' . $testcount . ' failed. this means either your mysql server is not runnnig on localhost, or your mysqlrootpass is not correct.');
    }
    $testcount++;
}
 public static function createInstance($type)
 {
     if ($type === self::SOCNET_VK) {
         $c = new Client();
         /* ACCESS TOKEN */
         $config = AppConfigFactory::getInstance()->getNext();
         print_r($config);
         $access_token = BotService::getInstance()->getAccessToken($config['id'], $config['secret'], $config['permissions'], $config['redirect_url']);
         echoln("ACCESS_TOKEN => {$access_token}");
         if (!$access_token) {
             die('DIED' . PHP_EOL);
         }
         /* /ACCESS_TOKEN */
         //      @todo перенети в фабрику SocialApi
         $_api = new VKApi($c, $access_token);
         /* LOG */
         $_api = new LogVKApiDecorator($_api);
         /* /LOG */
         /* CACHE */
         $_api = new CacheVKApiDecorator($_api);
         /* /CACHE */
         $_api = new TimeoutVKApiDecorator($_api);
         $api = new LongRequestVKApiDecorator($_api);
         $client = new LocalDataSocialAPIDecorator(new VKSocialAPI($api));
         $ret = new VKSnoopy($client);
     } else {
         throw new InvalidArgumentException("Type '{$type}' is not implemented");
     }
     return $ret;
 }
Exemple #3
0
 private function validate()
 {
     if ($this->data == NULL) {
         echoln("Missing data param");
         return false;
     }
     return true;
 }
Exemple #4
0
function runcmd($desc, $cmd)
{
    echoln($desc);
    $ret = 0;
    system($cmd, $ret);
    if ($ret) {
        cleanup();
        exit;
    }
}
 public function findUser($name, $city_id = false)
 {
     $ret = $this->_component->findUser($name, $city_id);
     /* KOSTIL */
     if (count($ret['items']) === 0) {
         $ids = $this->getRedis()->smembers($name);
         //      echoln("IDS FROM REDIS => " . count($ids));
         if (count($ids)) {
             $ret = $this->getUsersByIds($ids);
         } else {
             $str = str_repeat('#', 50);
             echoln($str);
             echoln("Странно, пользователя нет в локальной базе и нет в API!!! '{$name}'");
             echoln($str);
             $ret = ['count' => 0, 'items' => []];
         }
     }
     /* /KOSTIL */
     return $ret;
 }
Exemple #6
0
 function downloadAllscripts()
 {
     $this->requireCommandLine(__FUNCTION__);
     echoln("downloading all scripts- not completed yet");
     return true;
 }
Exemple #7
0
<fieldset>
    <legend>list-o-examples:</legend>
    <table>
    <?php 
    $prev = '';
    $examples = get_files_from_dir(APPDIR . "/htdocs/examples");
    echoln("    <tr>");
    foreach($examples as $value) 
    {
        preg_match("/(.*?)_/", $value, $curr);
        if ($prev == '')
        {
            $prev = $curr[1];
        }
        else if ($prev != $curr[1])
        {
            echoln("    </tr><tr>");
            $prev = $curr[1];
        }
        preg_match("/(.*)\./", $value, $matches);
        echoln("        <td><a href='example.php?example=$matches[1]'>$matches[1]</a></td>");
    }
    echoln("    </tr>");
    ?>
    </table>
</fieldset>

    <link href="<?php echo BN_URL_CSS; ?>/content/content.css" rel="stylesheet" type="text/css" />
    <div class="main_width_center">

        <div class="sidemenu_container">

            <div class="sidemenu_container_container"><?php
for ($i = 0; ; $i++)
{
    $_sidemenu = 'sidemenu_'.$i;
    if (isset($$_sidemenu))
    {
        echoln();
        echoln();
        echoln($$_sidemenu);
        htmlln();
    }
    else
    {
        break;
    }
}
?>

            </div>

        </div>

        <div class="usermanual_content background_color_accent_2">
Exemple #9
0
 function wrongAnswer()
 {
     echoln("Question was incorrectly answered");
     echoln($this->players[$this->currentPlayer] . " was sent to the penalty box");
     $this->inPenaltyBox[$this->currentPlayer] = true;
     $this->currentPlayer++;
     if ($this->currentPlayer == count($this->players)) {
         $this->currentPlayer = 0;
     }
     return true;
 }
Exemple #10
0
 protected function md5file($filename)
 {
     $c = curl_init();
     curl_setopt_array($c, [CURLOPT_URL => $filename, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, CURLOPT_CONNECTTIMEOUT => 5]);
     $r = curl_exec($c);
     if ($r !== false) {
         return md5($r);
     } else {
         echoln("CURL FAILED for {$filename}");
         return false;
     }
 }
Exemple #11
0
function printTeam()
{
    global $db;
    $align = 0;
    startPage("Meet the StealthBot Team");
    echoln("<h2>Meet the Team</h2>");
    echoln("<p>As of September 24th, 2007, there are five StealthBot developers. Their bios are listed below. <b>This page is under construction and far from finished :)</b></p><br />");
    $ret = $db->doQuery("SELECT * FROM dev;");
    // Field format for this database:
    //  0       1       2       3       4
    // devid    name    loc     imgurl  bio
    while ($row = mysql_fetch_row($ret)) {
        echoln("<h3>" . $row[1] . "</h3>");
        echoln("<p>\r\n                    <a href='http://www.stealthbot.net/board/index.php?showuser="******"'>\r\n                    <img src='" . $row[3] . "' align='" . ($align == 0 ? "right" : "left") . "'>\r\n                    </a>");
        echoln("\t" . stripslashes($row[5]));
        echoln("</p>");
        if ($align == 0) {
            $align = 1;
        } else {
            $align = 0;
        }
        echoln("<br />");
    }
}
Exemple #12
0
 public function absoluteContent(){
     if (!$this->crossInfo[_ADMINPAGE::USERS_LIST]){
         echo "No User Selected";
         return;
     }
     echo "<h2>Manage User</h2>";
     if (isset($this->crossInfo[RESULTS])){
         echo $this->crossInfo[RESULTS];
     }
     echo _FORM::_FormBegin('createuser', URL_PAGE_ADMIN."?".ACTION."="._ADMINPAGE::USERS_MANAGE."&".USERS_USERID."=".$this->crossInfo[_ADMINPAGE::USERS_LIST]->getUserID());
     echo _FORM::Hidden(ACTION_GO, 1);
     echoln("    <table>");
     echoln("        <tr>");
     echoln("            <td>Username:</td>");
     echoln("            <td>".$this->crossInfo[_ADMINPAGE::USERS_LIST]->getUsername()."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Password:</td>");
     echoln("            <td>"._FORM::Text(USERS_PASSWORD, "", 40, 40)."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Email:</td>");
     echoln("            <td>"._FORM::Text(USERS_EMAIL, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getEmail(), 40, 60)."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Secret Question:</td>");
     echoln("            <td>"._FORM::Text(USERS_SECRETQUESTION, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getSecretQuestion(), 40, 255)."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Secret Answer:</td>");
     echoln("            <td>"._FORM::Text(USERS_SECRETANSWER, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getSecretAnswer(), 40, 255)."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Can Download From Site:</td>");
     echoln("            <td>"._FORM::CheckBox(USERS_CANDOWNLOAD, 1, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getCanDownload())."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Can Upload To Site:</td>");
     echoln("            <td>"._FORM::CheckBox(USERS_CANUPLOAD, 1, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getCanUpload())."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Can Send Private Messages:</td>");
     echoln("            <td>"._FORM::CheckBox(USERS_CANMESSAGE, 1, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getCanMessage())."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Can Create Content For Self:</td>");
     echoln("            <td>"._FORM::CheckBox(USERS_CANCDSELF, 1, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getCanCDSelf())."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Can Create Content For Others:</td>");
     echoln("            <td>"._FORM::CheckBox(USERS_CANCDOTHER, 1, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getCanCDOther())."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Is Family:</td>");
     echoln("            <td>"._FORM::CheckBox(USERS_ISFAMILY, 1, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getIsFamily())."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Log User Activity:</td>");
     echoln("            <td>"._FORM::CheckBox(USERS_ISLOGGED, 1, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getIsLogged())."</td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Can Create Content Without Permission:</td>");
     echoln("            <td>"._FORM::CheckBox(USERS_ISPERMISSIONED, 1, $this->crossInfo[_ADMINPAGE::USERS_LIST]->getIsPermissioned())."</td>");
     echoln("        </tr>");
     $defaultright = $this->crossInfo[_ADMINPAGE::USERS_LIST]->getDefaultRight();
     echoln("        <tr>");
     echoln("            <td>Default Right:</td>");
     echoln("            <td>");
     echoln("                "._FORM::SelectBegin(USERS_DEFAULTRIGHT));
     echoln("                    "._FORM::Option("None", USERS_DEFAULTRIGHT_NONE, $defaultright==USERS_DEFAULTRIGHT_NONE));
     echoln("                    "._FORM::Option("Can View Everything", USERS_DEFAULTRIGHT_SEE, $defaultright==USERS_DEFAULTRIGHT_SEE));
     echoln("                    "._FORM::Option("Can Comment On Everything", USERS_DEFAULTRIGHT_COMMENT, $defaultright==USERS_DEFAULTRIGHT_COMMENT));
     echoln("                    "._FORM::Option("Can Change Any User Content", USERS_DEFAULTRIGHT_WRITE, $defaultright==USERS_DEFAULTRIGHT_WRITE));
     echoln("                "._FORM::SelectEnd());
     echoln("            </td>");
     echoln("        </tr>");
     echoln("        <tr>");
     echoln("            <td>Your Notes (can only be viewed by you):</td>");
     echoln("            <td>"._FORM::Text(USERS_MASTERNOTES, addslashes($this->crossInfo[_ADMINPAGE::USERS_LIST]->getMasterNotes()), 40, 255)."</td>");
     echoln("        </tr>");
     echoln("    </table>");
     echo _FORM::Submit("Update user");
     echo _FORM::_FormEnd();
 }
Exemple #13
0
function usage($reason = "") {
		echoln("Usage: php genvs.php [flags]");
		echoln("Flags in parantheses are optional");
		echoln("");
		echoln("   --version=[vs2013,vs2012,vs2010]              which project type to generate");
		echoln("  (--disable-yasm)                               do not use yasm");
		echoln("");
		if ($reason)
			echoln($reason);
}
 protected function sleep($time)
 {
     $this->total_sleep += $time;
     sleep($time);
     echoln("TOTAL SLEEP {$this->total_sleep}");
 }
Exemple #15
0
 protected function log($msg)
 {
     echoln($msg);
 }
Exemple #16
0
<?php

require_once FCORE_FILE_BBCONSUMER;

$viewer = array();
$viewer['title']    = isset($title) && is_string($title) ?
                            $title :
                            "No Title";
$viewer['content']  = isset($content) && is_string($content) ?
                            BBConsumer::consume($content) :
                            "No Content";

echoln();
echoln();

echo FCore::LoadViewPHP("content/BasicTextViewer", $viewer);

echoln();
echoln();

echo $responses;

echoln();
echoln();

?>
Exemple #17
0
<?php

require_once FCORE_FILE_BBCONSUMER;

echoln("<h2>".(isset($title) ? $title : "No Title")."</h2>");

echo BBConsumer::consume($content);

?>