Example #1
0
function viewInfo($file)
{
    global $FFPROBE, $FROM_DIR;
    $vcodec = null;
    $acodec = null;
    $cmd = $FFPROBE . " -v quiet -print_format json -show_format -show_streams -i " . escapeshellarg($file) . " 2>&1";
    exec($cmd, $out, $err);
    echo $cmd . "\n";
    if ($err == 0) {
        $str = "";
        for ($i = 0; $i < sizeof($out); $i++) {
            $str .= $out[$i];
            //echo "\t" . $out[$i] . "\n";
        }
        $data = json_decode($str);
        $sfile = str_replace($FROM_DIR, '', $data->{'format'}->{'filename'});
        echo "filename: " . $sfile . "\n";
        //$num_codecs = $data->{'format'}->{'nb_streams'};
        checkDB($sfile);
        foreach ($data->{'streams'} as $stream) {
            if ($stream->{'codec_type'} == 'audio') {
                $acodec = isset($stream->{'codec_name'}) ? $stream->{'codec_name'} : null;
            }
            if ($stream->{'codec_type'} == 'video') {
                $vcodec = isset($stream->{'codec_name'}) ? $stream->{'codec_name'} : null;
            }
            echo "codec " . $stream->{'codec_type'} . ", " . (isset($stream->{'codec_name'}) ? $stream->{'codec_name'} : "") . "\n";
        }
        echo "\n";
        return isset($acodec) & isset($vcodec);
    } else {
        echo "Error executing " . $FFPROBE . "\n";
        return false;
    }
}
Example #2
0
 function step07_dealSQL()
 {
     // $this->closeSite();
     $filePath = $targetDir = DATA_PATH . '/update/download/unzip/updateDB.php';
     if (!file_exists($filePath)) {
         // 如果本次升级没有数据库的更新,直接返回
         echo 1;
         exit;
     }
     require_once $filePath;
     updateDB();
     unlink($filePath);
     // 数据库验证
     $filePath = $targetDir = DATA_PATH . '/update/download/unzip/checkDB.php';
     if (!file_exists($filePath)) {
         // 如果本次升级没有数据库的更新后的验证代码,直接返回
         echo 1;
         exit;
     }
     require_once $filePath;
     // checkDB方法正常返回1 否则返回异常的说明信息,如:ts_xxx数据表创建不成功
     checkDB();
     unlink($filePath);
     echo 1;
 }
Example #3
0
 $dbuser = isset($_POST['dbuser']) ? $_POST['dbuser'] : '';
 $port = isset($_POST['port']) ? $_POST['port'] : '3306';
 $dbpwd = isset($_POST['dbpwd']) ? $_POST['dbpwd'] : '';
 $dbhost = isset($_POST['dbhost']) ? $_POST['dbhost'] : '';
 $dbprefix = isset($_POST['dbprefix']) ? $_POST['dbprefix'] : '';
 $language = isset($_POST['language']) ? $_POST['language'] : 'zh_cn';
 $accept = isset($_POST['accept']) ? true : false;
 if (!$accept) {
     $result = -1;
     $target = 'alert';
     $info = t('bugfree', 'don\'t accept the license');
 } else {
     list($result, $info, $target, $con) = getDBCon($dbhost, $port, $dbuser, $dbpwd);
     // db con check
     if (!$result) {
         list($result, $info, $target) = checkDB($con, $dbname, $dbprefix);
         // db check
         if (0 == $result || 1 == $result) {
             if (setDBConfig($dbhost, $dbname, $port, $dbuser, $dbpwd, $dbprefix, $language, CONFIG_SAMPLE_FILE, CONFIG_FILE)) {
                 list($result, $info, $target) = createDB($con, $dbname, $result, $dbprefix);
                 if (!$result) {
                     file_put_contents('install.lock', '');
                 }
             }
         } else {
             if (2 == $result) {
                 setDBConfig($dbhost, $dbname, $port, $dbuser, $dbpwd, $dbprefix, $language, CONFIG_SAMPLE_FILE, CONFIG_FILE);
             }
         }
         @mysql_close($con);
     }
Example #4
0
	<thead>
		<tr>
			<th>Status</th>
			<th width="40">Name</th>
			<th>Description</th>
			<th>Solution</th>
		</tr>
	</thead>

	<?php 
$data = array();
$data[] = checkRemoteConnection();
//$data[] = checkPhpVersion();
//$data[] = checkCache();
$data[] = checkPROMode();
$tmp = checkDB();
$data = array_merge($data, $tmp);
foreach ($data as $test) {
    echo "<tr>\n";
    $img = "components/com_ganalytics/views/tools/tmpl/ok.png";
    if ($test['status'] == "failure") {
        $img = "components/com_ganalytics/views/tools/tmpl/failure.png";
    } else {
        if ($test['status'] == "warning") {
            $img = "components/com_ganalytics/views/tools/tmpl/warning.png";
        }
    }
    echo "<td width=\"17\" align=\"center\"><img src=\"" . $img . "\" width=\"16\" height=\"16\"/></td>\n";
    echo "<td width=\"120\">" . $test['name'] . "</td><td>" . $test['description'] . "</td><td>" . $test['solution'] . "</td>";
    echo "</tr>\n";
}
Example #5
0
function instImportPages(&$session, $import_file, $import_replace)
{
    $message = null;
    if (!file_exists($import_file)) {
        $message = "Datei nicht gefunden: " . $import_file;
    } elseif (checkDB($session, $message) == DB_EXISTS) {
        $file = fopen($import_file, "r");
        $count_inserts = 0;
        $count_updates = 0;
        $count_lines = 0;
        while ($line = fgets($file)) {
            if (preg_match('/^#name=(\\S+)\\tlines=(\\d+)\\ttype=(\\w+)\\t/', $line, $param)) {
                $name = $param[1];
                $lines = $param[2];
                $type = $param[3];
                $session->trace(TC_Gui1, 'instImportPagesAnswer-2: ' . $line);
                if (($page = dbPageId($session, $name)) > 0) {
                    $count_updates++;
                    if ($import_replace) {
                        dbDeleteByClause($session, T_Text, 'page=' . $page);
                    }
                } else {
                    $page = dbInsert($session, T_Page, 'name,type', dbSqlString($session, $name) . ',' . dbSqlString($session, $type));
                    $count_inserts++;
                }
                $text = "";
                $session->trace(TC_Gui1, 'instImportPagesAnswer-3: ' . $lines);
                $count_lines += $lines;
                for ($ii = 0; $ii < $lines; $ii++) {
                    $text .= fgets($file);
                }
                if ($import_replace) {
                    $old_id = dbSingleValue($session, 'select max(id) from ' . dbTable($session, T_Text) . ' where page=' . (0 + $page));
                }
                $text_id = dbInsert($session, T_Text, 'page,type,text', $page . ',' . dbSqlString($session, $type) . ',' . dbSqlString($session, $text));
                if ($import_replace && $old_id > 0) {
                    dbUpdate($session, T_Text, $old_id, 'replacedby=' . $text_id);
                }
            }
        }
        fclose($file);
        $message = 'Datei ' . $import_file . ' wurde eingelesen. Neu: ' . (0 + $count_inserts) . ' Geändert: ' . (0 + $count_updates) . ' Zeilen: ' . (0 + $count_lines);
    }
    return $message;
}
Example #6
0
        // Keep connection alive (<300s)
        if ($pollCount % calculateTick(60 * 2) == 0) {
            echo '[keep-alive] Ping sent' . "\n";
            $wa->sendPing();
        }
        // usage of 39512f5ea29c597f25483697471ac0b00cbb8088359c219e98fa8bdaf7e079fa
        $pollCount++;
        // Draw the socket read a draw
        if ($tick_end - $tick_start < 2.0) {
            sleep(2);
        }
    }
}
do {
    // Check database
    if (!checkDB($DBH, $dbTables)) {
        echo '[DB-check] Table\'s do not exist in database "' . $dbAuth['dbname'] . '". Check the troubleshooting page.' . "\n";
        exit;
    }
    try {
        // Start the tracker
        track();
    } catch (Exception $e) {
        try {
            // Kill any event listeners
            foreach ($tracking_numbers as $number) {
                $wa->sendPresenceUnsubscription($number);
            }
        } catch (Exception $e) {
            // Connection closed, nevermind
        }
Example #7
0
}
if (!isset($db_name)) {
    $db_name = $session->fDbName;
}
if (!isset($db_prefix)) {
    $db_prefix = $session->fDbTablePrefix;
}
$db_status = checkDB($session);
if ($db_status == NO_DB && isset($db_createdb)) {
    $query = "create database {$db_name};";
    $result = mysql_query($query, $session->fDbInfo);
    if (!$result) {
        echo "<p>+++ DB {$db_name} nicht erzeugt: " . htmlentities(mysql_error()) . "</p>\n";
    } else {
        echo "<p>DB {$db_name} wurde erzeugt</p>\n";
        $db_status = checkDB($session);
    }
}
if ($table_status = checkTableStatus($db_status, $tables_exist)) {
    echo "<p>{$table_status}</p>\n";
}
if (isset($db_overwrite)) {
    echo "db_overwrite: {$db_overwrite}<br/>\n";
}
if (isset($db_populate) && (!isset($db_overwrite) || $db_overwrite == "J")) {
    populate($session, $file);
} else {
    echo "<form name=\"form\" action=\"install.php\" method=\"post\">\n";
    echo '<table><tr><td>MySQL-Server</td><td>';
    guiTextField('db_server', $db_server, 16, 0);
    echo "</td></tr>\n<tr><td>Datenbank</td><td>";
Example #8
0
function populate($session, $fn_sql)
{
    global $db_prefix;
    $message = '';
    if (checkDB($session, $message) == DB_EXISTS) {
        if (!($file = fopen($fn_sql, "r"))) {
            $message = "+++ Kann Datei nicht &ouml;ffnen: {$fn_sql}";
        } else {
            $status = null;
            $line_count = $comments = 0;
            while (!feof($file)) {
                $line_count++;
                $line = fgets($file, 64000);
                if (strlen($line) <= 3 || ($pos = strpos($line, '#')) == 0 && is_int($pos) || ($pos = strpos($line, '//')) == 0 && is_int($pos)) {
                    $comments++;
                } else {
                    if ($status == 'create') {
                        $sql .= ' ' . $line;
                        if (($pos = strpos($line, ')')) == 0 && is_int($pos)) {
                            sqlStatement($session, $sql);
                            $status = null;
                        } else {
                        }
                    } elseif (($pos = strpos($line, 'CREATE TABLE')) == 0 && is_int($pos)) {
                        $sql = str_replace('infobasar_', $db_prefix, $line);
                        $status = 'create';
                    } else {
                        if (($pos = strpos($line, 'ROP TABLE')) == 1) {
                            $line = str_replace('infobasar_', $db_prefix, $line);
                        } elseif (($pos = strpos($line, 'NSERT INTO')) == 1) {
                            $line = str_replace(' INTO infobasar_', ' INTO ' . $db_prefix, $line);
                        } elseif (($pos = strpos($line, 'PDATE ')) == 1) {
                            $line = str_replace('UPDATE infobasar_', 'UPDATE ' . $db_prefix, $line);
                        }
                        sqlStatement($session, $line);
                    }
                }
            }
            fclose($file);
            $message = 'Die Infobasar-Tabellen wurden initialisiert: ' . (0 + $line_count) . ' Zeilen gelesen, davon ' . (0 + $comments) . ' Kommentare';
        }
    }
    return $message;
}
Example #9
0
    mysql_select_db($dbname) or die("Can not Database");
    $Status = "";
    $sqlCmd = "SELECT status ";
    $sqlCmd .= "FROM   member ";
    $sqlCmd .= "WHERE  mobile_no = '{$Mobile_No}' ";
    $result = mysql_query($sqlCmd) or die("Can not select data<br>{$sqlCmd}");
    if ($row = mysql_fetch_array($result)) {
        $Status = $row['status'];
    }
    mysql_free_result($result);
    if ($Status == "") {
        $Password = strtolower(str_replace("0", "T", str_replace(".", "U", str_replace("/", "N", substr(crypt($Mobile_No), -8)))));
        //          $Message = "���ʼ�ҹ�ͧ��ҹ ��� " . $Password;
        //          $i = Send_Content($Mobile_No, "1", $Message);
        if ($i == 1) {
            $sqlCmd = "INSERT INTO member(mobile_no, password, sex, birthdate, province, email, status, reg_date) VALUES('{$Mobile_No}', '" . checkDB($Password) . "','{$Sex}', '{$BirthDate}', '{$Province}', '{$Email}', 'Y', now()) ";
            mysql_query($sqlCmd) or die("Can not select data<br>{$sqlCmd}");
            $subject = '���ʼ�ҹ ���䫵���������ԡ������������Ѿ������͹���ͧ��з�ǧ�Ѳ����� ';
            $message = '���ʼ�ҹ�ͧ��ҹ ��� ' . $Password;
            $headers = 'From: webmaster@m-culture.go.th' . "\r\n";
            mail($Email, $subject, $message, $headers);
            $Msg = "�к���ӡ�èѴ�����ʼ�ҹ��ѧ ������ͧ��ҹ���º�������� �ͺ�س�ҡ��";
        } else {
            $Msg = "�к��������ö�ӡ�èѴ�����ʼ�ҹ��ѧ��Ͷ�ͧ͢��ҹ�� ��سҵ�Ǩ�ͺ�ա���� �ͺ�س�ҡ��";
        }
        mysql_close();
        ?>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
      <SCRIPT LANGUAGE="JavaScript">
function checkCookie()
{
    global $user, $HTTP_SERVER_VARS, $HTTP_COOKIE_VARS;
    $PHP_AUTH_PW = $HTTP_SERVER_VARS['PHP_AUTH_PW'];
    $PHP_AUTH_USER = $HTTP_SERVER_VARS['PHP_AUTH_USER'];
    $phpMyCalendar = $HTTP_COOKIE_VARS['phpMyCalendar'];
    //no cookie:
    if (strcmp($phpMyCalendar, "") == 0) {
        if (checkDB($PHP_AUTH_USER, md5($PHP_AUTH_PW)) == false) {
            return false;
        } else {
            return true;
        }
    } else {
        $login = explode("_", $phpMyCalendar);
        if ((strcmp($login[0], $PHP_AUTH_USER) != 0 or strcmp($login[1], md5($PHP_AUTH_PW)) != 0) and checkDB($login[0], $login[1]) == false) {
            return false;
        } else {
            createUser($PHP_AUTH_USER);
            return true;
        }
    }
    //end if
}
Example #11
0
            echo border('syellow', 'start', $wordings[$roster_conf['roster_lang']]['RaidTracker']);
        }
    }
    echo '<table cellpadding="0" cellspacing="0" class="membersList"><tr>';
    echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker">' . $wordings[$roster_conf['roster_lang']]['RaidTracker'] . '</a></td>';
    echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker&amp;display=history">' . $rt_wordings[$roster_conf['roster_lang']]['LootHistory'] . '</a></td>';
    echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker&amp;display=bosses">' . $rt_wordings[$roster_conf['roster_lang']]['BossProgress'] . '</a></td>';
    echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker&amp;display=bossesBC">' . $rt_wordings[$roster_conf['roster_lang']]['BossProgressBC'] . '</a></td>';
    echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker&amp;display=attendance">' . $rt_wordings[$roster_conf['roster_lang']]['Attendance'] . '</a></td>';
    echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker&amp;display=summary">' . $rt_wordings[$roster_conf['roster_lang']]['Summary'] . '</a></td>';
    echo '<td class="membersHeaderRight"><a href="addon.php?roster_addon_name=RaidTracker&amp;display=admin">' . $rt_wordings[$roster_conf['roster_lang']]['Admin'] . '</a></td>';
    echo '</tr></table>';
    echo border('syellow', 'end');
    echo '<br/>';
}
$result = checkDB($db_prefix . "raids");
$reinstall = !$result ? 1 : 0;
// Check if tables already excists
if (!$result || $reinstall) {
    require 'install_db.php';
} else {
    if ($display == '') {
        if ($raid != '') {
            require 'raidview.php';
        } else {
            require 'raidlist.php';
        }
    }
    if ($display == 'history') {
        if ($color != '') {
            require 'lootview.php';
Example #12
0
                        }
                        if ($db["level"] == 2 || $db["level"] == 4 || $db["level"] == 8 || $db["level"] == 1) {
                            $bAccessAllowed = true;
                        }
                    }
                }
            } else {
                //echo "DB not selected:".mysql_error()."<br>";
            }
        }
    } else {
        //Check user credentials against LDAP
        $check = ldapAuthenticate($_REQUEST['UserId'], $_REQUEST['Password'], false);
        if ($check['passed']) {
            //See if user is in the database
            $db = checkDB($_REQUEST['UserId'], $_REQUEST['Password']);
            if ($db[success]) {
                if ($db[level] == 2 || $db[level] == 4 || $db[level] == 8 || $db[level] == 1) {
                    $bAccessAllowed = true;
                }
            } else {
                //LDAP Credentials failed
                $bAccessAllowed = false;
            }
        } else {
            //LDAP Credentials failed
            $bAccessAllowed = false;
        }
    }
}
$_SESSION['SESSION_CUTEFLOW_USERNAME'] = $_REQUEST['UserId'];