Beispiel #1
0
    escapes('start', 0);
}
$where = '';
$matchColl = new MatchCollection("AND");
$owner = '+ALL';
$project = '+ALL';
if (isset($_GET['owner']) && $_GET['owner'] != '+ALL') {
    escapes('owner', $_GET['owner']);
    $matchColl->addMatch(new Match('user', $mowner));
}
if (isset($_GET['project']) && $_GET['project'] != '+ALL') {
    escapes('project', $_GET['project']);
    $matchColl->addMatch(new Match('name', $mproject));
}
$whereSQL = $matchColl->toSQL();
mysqlSetup();
$sqlquery = "SELECT DISTINCT `user` " . "FROM `pb_blog` ORDER BY `user` ASC";
$result = mysql_query($sqlquery) or die('Invalid query: ' . mysql_error());
?>

<table>
<tr>
<td>
<form name="selectOwner" method="get" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
<input type="hidden" name="start" value="<?php 
echo $start;
?>
" />
Beispiel #2
0
<title> Welcome to DSL FAITH </title>
<style type="text/css">
<?php 
echo htmlentities(file_get_contents('faith_style.css', true));
?>
</style>
</head>
<table cellspacing="0" cellpadding="0" width="750px">
<tr>
	<td>
	<?php 
require_once 'func.php';
require_once 'vars.php';
require_once 'facebook.php';
try {
    mysqlSetup($db);
    $facebook = new Facebook($appapikey, $appsecret);
    $user_id = $facebook->require_login();
    $results = mysql_query("SELECT transform_add.transform_add_id,\n\t\t\t\t\t\t\t\t   transform_add.add_uid_a,\n\t\t\t\t\t\t\t\t   transform_add.add_time,\n\t\t\t\t\t\t\t\t   transform_add.social_path,\n\t\t\t\t\t\t\t\t   transform_add.status\n\t\t\t\t\t\t\t\t   from transform_add\n\t\t\t\t\t\t\t\t   where transform_add.add_uid_b = {$user_id} AND\n\t\t\t\t\t\t\t\t   \t     transform_add.status = 0\n\t\t\t\t\t\t\t\t   order by transform_add.add_time DESC", $db);
    $div_counter = 0;
    while ($row = mysql_fetch_array($results)) {
        $div_counter++;
    }
    display_header_links($div_counter, $user_id);
} catch (Exception $e) {
    echo 'Caught database exception: ', $e->getMessage(), "\n";
}
?>
	</td>
</tr>
<tr>
Beispiel #3
0
function faith_accessAllowed($faith_uid, $faith_client_ip, $faith_app_id, $api_method, $api_array, $result)
{
    if (!isset($faith_uid)) {
        return false;
    }
    if (!isset($faith_client_ip)) {
        return false;
    }
    if (!isset($faith_app_id)) {
        return false;
    }
    if (!isset($api_method)) {
        return false;
    }
    mysqlSetup($db);
    $app_ip_addr = $_SERVER['REMOTE_ADDR'];
    $api_blocked = mysql_query("SELECT Count(*) as CountAPI_Num\n\t\t\t\t\t\t   \t\tfrom user_disable_api, restapi\n\t\t\t\t\t\t   \t\twhere user_disable_api.uid = {$faith_uid} AND\n\t\t\t\t\t\t   \t\t \t  restapi.facebook_method = '{$api_method}' AND\n\t\t\t\t\t\t   \t\t\t  user_disable_api.restapi_id = restapi.id;", $db);
    $api_blocked_row = mysql_fetch_array($api_blocked);
    $CountAPI_Num = $api_blocked_row['CountAPI_Num'];
    $app_blocked = mysql_query("SELECT Count(*) as CountAPP_Num\n\t\t\t\t\t\t   \t\tfrom user_disable_app\n\t\t\t\t\t\t   \t\twhere user_disable_app.uid = {$faith_uid} AND\n\t            \t\t\t\t\t  user_disable_app.app_id = {$faith_app_id};", $db);
    $app_blocked_row = mysql_fetch_array($app_blocked);
    $CountAPP_Num = $app_blocked_row['CountAPP_Num'];
    $Count_Num = $CountAPI_Num + $CountAPP_Num;
    fwrite($fh, "(restserver.php)Count_Num = {$Count_Num}\n");
    $allowed = '1';
    if ($Count_Num > 0) {
        $allowed = '0';
    }
    $logging_setting = '0';
    $results = mysql_query("SELECT logging_setting\n\t\t\t\t\t\t\t\t   from setting_logging\n\t\t\t\t\t\t\t\t   where uid = {$faith_uid}", $db);
    while ($row = mysql_fetch_array($results)) {
        $logging_setting = $row['logging_setting'];
    }
    if ($logging_setting == '2' || $logging_setting == '3') {
        //$result = http_build_query($result);
        if (gettype($result) == 'array') {
            $array_str = '';
            foreach ($result as $index => $value) {
                $array_str = $array_str . ' { Array ' . $index . ' -> ';
                if (gettype($value) == 'array') {
                    foreach ($value as $inner_index => $inner_value) {
                        $array_str = $array_str . ' [ Array ' . $inner_index . ' -> ';
                        if (gettype($inner_value) == 'array') {
                            foreach ($inner_value as $most_inner_index => $most_inner_value) {
                                $array_str = $array_str . ' ( Array ' . $most_inner_index . ' -> ' . $most_inner_value . ' ) ';
                            }
                            $array_str = $array_str . ' ] ';
                        } else {
                            $array_str = $array_str . $inner_value . ' ] ';
                        }
                    }
                }
                $array_str = $array_str . ' } ';
            }
            $result = $array_str;
        }
        $faith_dsl_replay = 44;
        date_default_timezone_set('America/Los_Angeles');
        $time_added = date("Y-m-d H:i:s");
        $query = sprintf("INSERT INTO access_log (uid, \n\t\t\t\t\t\t\t\t\t\t\t\t  app_id,\n\t\t\t\t\t\t\t\t\t\t\t\t  allowed,\n\t\t\t\t\t\t\t\t\t\t\t\t  access_time,\n\t\t\t\t\t\t\t\t\t\t\t\t  logdetails,\n\t\t\t\t\t\t\t\t\t\t\t\t  parameter,\n\t\t\t\t\t\t\t\t\t\t\t\t  replay_type,\n\t\t\t\t\t\t\t\t\t\t\t\t  api_id,\n\t\t\t\t\t\t\t\t\t\t\t\t  app_ip_addr,\n\t\t\t\t\t\t\t\t\t\t\t\t  user_ip_addr) \n\t\t\t\t\t\t\t\t\t\t\t\t  VALUES('%s','%s','%s','%s','%s','%s','%s',(SELECT id FROM restapi where facebook_method = '{$api_method}'),INET_ATON('{$app_ip_addr}'),INET_ATON('{$faith_client_ip}'))", $faith_uid, mysql_real_escape_string($faith_app_id), mysql_real_escape_string($allowed), mysql_real_escape_string($time_added), mysql_real_escape_string($result), mysql_real_escape_string(json_encode($api_array)), mysql_real_escape_string($faith_dsl_replay));
        if (!mysql_query($query)) {
            return false;
        }
    }
    if ($Count_Num > 0) {
        return false;
    }
    return true;
}