本文整理匯總了PHP中session::get_session方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::get_session方法的具體用法?PHP session::get_session怎麽用?PHP session::get_session使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::get_session方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: logout
public static function logout($session_id)
{
$session = session::get_session($session_id);
$session->activ = "0";
$session->update();
return true;
}
示例2: get_list_with_session
public static function get_list_with_session($session_id)
{
$session = session::get_session($session_id);
if ($session->is_valid()) {
$user = ormlib::get_from_instance(new user(), array("id"), array($session->user_id));
if ($user !== null && $user->id !== null && $user->id !== "") {
if ($user->has_group(session::GROUP_METADATA) === true) {
$metadata_list = ormlib::get_list_from_instance(new metadata());
$mw_list = array();
for ($i = 0; $i < count($metadata_list); $i++) {
$md = $metadata_list[$i];
$mw = new metadata_wrapper($md);
$mw->metadata_field_list = ormlib::get_list_from_instance(new metadata_field(), array("metadata_id"), array($md->id));
for ($j = 0; $j < count($mv->metadata_field_list); $j++) {
$mw->metadata_field_selection[] = ormlib::get_list_from_instance(new metadata_field_selection(), array("metadata_field_id"), array($mv->metadata_field_list[$j]->id));
}
$mw->metadata_table_list = ormlib::get_list_from_instance(new metadata_table(), array("metadata_id"), array($md->id));
$mw->metadata_table_relation = ormlib::get_list_from_instance(new metadata_table_relation(), array("metadata_id"), array($md->id));
$mw->metadata_relation = array_merge($mv->metadata_relation, ormlib::get_list_from_instance(new metadata_table_relation(), array("metadata_id1"), array($md->id)));
$mw->metadata_relation = array_merge($mv->metadata_relation, ormlib::get_list_from_instance(new metadata_table_relation(), array("metadata_id2"), array($md->id)));
$mw_list[] = $mw;
}
return $mw_list;
}
}
}
return null;
}
示例3: check_and_remove
public static function check_and_remove($session_id, $user_id, $group_id)
{
$session = session::get_session($session_id);
if ($session != null && $session->is_valid()) {
$user = ormlib::get_from_instance(new user(), array("id"), array($session->user_id));
if ($user->has_group(session::GROUP_METADATA) === true) {
if ($user_id != "" && $group_id != "" && $user_id * 1 > 0 && $group_id * 1 > 0) {
ormlib::remove_from_instance(new user_group(), "`user_id` = {$user_id} and `group_id` = {$group_id}");
return array("response" => "OK");
} else {
return array("response" => "error", "message" => "user_id or group_id is empty or zero.");
}
}
}
return array("response" => "error", "message" => "no privileg");
}
示例4: get_list_with_session
public static function get_list_with_session($session_id)
{
$session = session::get_session($session_id);
if ($session != null && $session->is_valid()) {
$user_group = new user_group();
$report_privileg_list = array();
$user_group_list = $user_group->get_list(array("user_id"), array($session->user_id));
for ($i = 0; $i < count($user_group_list); $i++) {
$report_privileg = new report_privileg();
$report_privileg_list = array_merge($report_privileg_list, $report_privileg->get_list(array("group_id", "privileg_id"), array($user_group_list[$i]->group_id, report_privileg::PRIVILEG_ID_ACCESS)));
}
$report_list = array();
$report = new report();
for ($i = 0; $i < count($report_privileg_list); $i++) {
array_push($report_list, $report->get($report_privileg_list[$i]->report_id));
}
$session->update();
return $report_list;
}
return array();
}
示例5: die
<?php
if (!defined('INTERFACE_ACCESS')) {
die('Direct access not premitted');
}
$session_id = $_REQUEST["session_id"];
$session = session::get_session($session_id);
$user = ormlib::get_from_instance(new user(), array("id"), array($session->user_id));
if ($session->is_valid() === true && $user->has_group(session::GROUP_METADATA) === true) {
$metadata_table = ormlib::get_from_instance(new metadata_table(), array("id"), array($_REQUEST["table_id"]));
$metadata_table->remove();
//TODO Remove more elements
echo "true";
} else {
echo "no privileg";
}