コード例 #1
0
ファイル: troubleshoot.php プロジェクト: rohdoor/ehcp
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++;
}
コード例 #2
0
 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;
 }
コード例 #3
0
ファイル: upload.php プロジェクト: OandOSpaceboy/pamela
 private function validate()
 {
     if ($this->data == NULL) {
         echoln("Missing data param");
         return false;
     }
     return true;
 }
コード例 #4
0
ファイル: build-nix.php プロジェクト: 888/hs-nacl
function runcmd($desc, $cmd)
{
    echoln($desc);
    $ret = 0;
    system($cmd, $ret);
    if ($ret) {
        cleanup();
        exit;
    }
}
コード例 #5
0
 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;
 }
コード例 #6
0
ファイル: classapp.php プロジェクト: jprice/EHCP
 function downloadAllscripts()
 {
     $this->requireCommandLine(__FUNCTION__);
     echoln("downloading all scripts- not completed yet");
     return true;
 }
コード例 #7
0
ファイル: header.php プロジェクト: rexfleischer/web_dev
<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>
コード例 #8
0

    <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">
コード例 #9
0
ファイル: Game.php プロジェクト: LiviusP/trivia
 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;
 }
コード例 #10
0
ファイル: VKSnoopy.php プロジェクト: kirugan/snoopy
 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;
     }
 }
コード例 #11
0
ファイル: functions.php プロジェクト: DragonLegion/StealthBot
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 />");
    }
}
コード例 #12
0
ファイル: admin.php プロジェクト: rexfleischer/web_dev
 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();
 }
コード例 #13
0
ファイル: genvs.php プロジェクト: vstakhov/blake2b-opt
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);
}
コード例 #14
0
 protected function sleep($time)
 {
     $this->total_sleep += $time;
     sleep($time);
     echoln("TOTAL SLEEP {$this->total_sleep}");
 }
コード例 #15
0
ファイル: LogVKApiDecorator.php プロジェクト: kirugan/snoopy
 protected function log($msg)
 {
     echoln($msg);
 }
コード例 #16
0
ファイル: content_view.php プロジェクト: rexfleischer/web_dev
<?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();

?>
コード例 #17
0
ファイル: readmanual.php プロジェクト: rexfleischer/web_dev
<?php

require_once FCORE_FILE_BBCONSUMER;

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

echo BBConsumer::consume($content);

?>