本文整理汇总了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";
}