本文整理汇总了PHP中UrlManager::relation_url_user_exist方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlManager::relation_url_user_exist方法的具体用法?PHP UrlManager::relation_url_user_exist怎么用?PHP UrlManager::relation_url_user_exist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UrlManager
的用法示例。
在下文中一共展示了UrlManager::relation_url_user_exist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: WSRemoveUserFromPortal
function WSRemoveUserFromPortal($params)
{
if (!WSHelperVerifyKey($params['secret_key'])) {
return return_error(WS_ERROR_SECRET_KEY);
}
$userId = $params['user_id'];
$portalId = $params['portal_id'];
UrlManager::delete_url_rel_user($userId, $portalId);
$result = UrlManager::relation_url_user_exist($userId, $portalId);
if (empty($result)) {
return 1;
}
return 0;
}
示例2: api_get_access_url_from_user
// checking if the admin is registered in all sites
$url_string = '';
$my_user_url_list = api_get_access_url_from_user(api_get_user_id());
foreach ($url_list as $my_url) {
if (!in_array($my_url['id'], $my_user_url_list)) {
$url_string .= $my_url['url'] . ' <br />';
}
}
if (!empty($url_string)) {
Display::display_warning_message(get_lang('AdminShouldBeRegisterInSite') . '<br />' . $url_string, false);
}
// checking the current installation
if ($current_access_url_id == -1) {
Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo') . ': ' . api_get_path(WEB_PATH));
} elseif (api_is_platform_admin()) {
$quant = UrlManager::relation_url_user_exist(api_get_user_id(), $current_access_url_id);
if ($quant == 0) {
Display::display_warning_message('<a href="' . api_get_self() . '?action=register&sec_token=' . $parameters['sec_token'] . '">' . get_lang('ClickToRegisterAdmin') . '</a>', false);
}
}
// action menu
echo '<div class="actions">';
echo Display::url(Display::return_icon('new_link.png', get_lang('AddUrl'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'admin/access_url_edit.php');
echo Display::url(Display::return_icon('user.png', get_lang('ManageUsers'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'admin/access_url_edit_users_to_url.php');
echo Display::url(Display::return_icon('course.png', get_lang('ManageCourses'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'admin/access_url_edit_courses_to_url.php');
//echo Display::url(Display::return_icon('session.png', get_lang('ManageSessions'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH).'admin/access_url_edit_sessions_to_url.php');
$userGroup = new UserGroup();
if ($userGroup->getUseMultipleUrl()) {
echo Display::url(Display::return_icon('class.png', get_lang('ManageUserGroup'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'admin/access_url_edit_usergroup_to_url.php');
}
if (CourseCategoryManager::isMultipleUrlSupport()) {
示例3: add_user_to_url
/**
* Add a user into a url
* @author Julio Montoya
* @param $user_id
* @param $url_id
*
* @return boolean true if success
* */
public static function add_user_to_url($user_id, $url_id = 1)
{
$table_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
if (empty($url_id)) {
$url_id = 1;
}
$count = UrlManager::relation_url_user_exist($user_id, $url_id);
$result = true;
if (empty($count)) {
$sql = "INSERT INTO {$table_url_rel_user} (user_id, access_url_id)\n VALUES ('" . intval($user_id) . "', '" . intval($url_id) . "') ";
$result = Database::query($sql);
}
return $result;
}