本文整理汇总了PHP中ossn_isAdminLoggedin函数的典型用法代码示例。如果您正苦于以下问题:PHP ossn_isAdminLoggedin函数的具体用法?PHP ossn_isAdminLoggedin怎么用?PHP ossn_isAdminLoggedin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ossn_isAdminLoggedin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ossn_wall_post_menu
/**
* View post menu
*
* @param string $hook Name of hook
* @param string $type Hook type
* @param string $return mixed data
* @param array $params Arrays or Objects
*
* @return mixed data
* @access private
*/
function ossn_wall_post_menu($hook, $type, $return, $params)
{
if ($params['post']->poster_guid == ossn_loggedin_user()->guid || $params['post']->owner_guid == ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) {
$deleteurl = ossn_site_url("action/wall/post/delete?post={$params['post']->guid}", true);
ossn_register_menu_link("delete", ossn_print('ossn:post:delete'), array('class' => 'ossn-wall-post-delete', 'href' => $deleteurl, 'data-guid' => $params['post']->guid), 'wallpost');
} else {
ossn_unregister_menu('delete', 'wallpost');
}
return ossn_view_menu('wallpost', 'wall/menus/post-controls');
}
示例2: ossn_trigger_upgrades
/**
* Trigger upgrade / Run upgrade
*
* @return void;
* @access private
*/
function ossn_trigger_upgrades()
{
if (!ossn_isAdminLoggedin()) {
ossn_kill_upgrading();
ossn_error_page();
}
$upgrades = ossn_get_process_upgrade_files();
if (!is_array($upgrades) || empty($upgrades)) {
ossn_trigger_message(ossn_print('upgrade:not:available'), 'error');
ossn_kill_upgrading();
redirect('administrator');
}
foreach ($upgrades as $upgrade) {
$file = ossn_route()->upgrade . "upgrades/{$upgrade}";
if (!(include_once $file)) {
throw new exception(ossn_print('upgrade:file:load:error'));
}
}
//need to reset cache files
if (ossn_site_settings('cache') !== 0) {
ossn_trigger_css_cache();
ossn_trigger_js_cache();
}
return true;
}
示例3: html_sidebar
/**
* Home sidebar initlize the component
*
* return void
*/
function html_sidebar()
{
ossn_add_hook('newsfeed', "sidebar:right", 'html_widget');
ossn_register_com_panel('HtmlSidebar', 'settings');
if (ossn_isAdminLoggedin()) {
ossn_register_action('html/sidebar/save', __HTML_SIDEBAR__ . 'actions/save.php');
}
}
示例4: ossn_ads
/**
* Initialize Ads Component
*
* @return void;
* @access private
*/
function ossn_ads()
{
ossn_register_com_panel('OssnAds', 'settings');
if (ossn_isAdminLoggedin()) {
ossn_register_action('ossnads/add', __OSSN_ADS__ . 'actions/add.php');
ossn_register_action('ossnads/edit', __OSSN_ADS__ . 'actions/edit.php');
ossn_register_action('ossnads/delete', __OSSN_ADS__ . 'actions/delete.php');
}
ossn_register_page('ossnads', 'ossn_ads_handler');
ossn_extend_view('css/ossn.default', 'css/ads');
ossn_extend_view('css/ossn.admin.default', 'css/ads.admin');
}
示例5: ossn_admin
/**
* Initialize the admin library
*
* @return void
*/
function ossn_admin()
{
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:components', ossn_site_url('administrator/components'), ossn_print('admin:sidemenu:components'));
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:install', ossn_site_url('administrator/com_installer'), ossn_print('admin:sidemenu:components'));
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:themes', ossn_site_url('administrator/themes'), ossn_print('admin:sidemenu:themes'));
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:install', ossn_site_url('administrator/theme_installer'), ossn_print('admin:sidemenu:themes'));
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:basic', ossn_site_url('administrator/settings/basic'), ossn_print('admin:sidemenu:settings'));
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:cache', ossn_site_url('administrator/cache'), ossn_print('admin:sidemenu:settings'));
//ossn_register_admin_sidemenu('admin/sidemenu', 'admin:mode', ossn_site_url('administrator/theme_installer'), ossn_print('admin:sidemenu:settings'));
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:users', ossn_site_url('administrator/users'), ossn_print('admin:sidemenu:usermanager'));
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:add:user', ossn_site_url('administrator/adduser'), ossn_print('admin:sidemenu:usermanager'));
ossn_register_admin_sidemenu('admin/sidemenu', 'admin:users:unvalidated', ossn_site_url('administrator/unvalidated_users'), ossn_print('admin:sidemenu:usermanager'));
ossn_register_menu_link('home', 'admin:dashboard', ossn_site_url('administrator'), 'topbar_admin');
ossn_register_menu_link('configure', 'Configure', '#', 'topbar_admin');
ossn_register_menu_link('help', 'admin:help', 'http://community.opensource-socialnetwork.org', 'topbar_admin');
ossn_register_menu_link('support', 'admin:support', 'http://community.opensource-socialnetwork.org', 'topbar_admin');
ossn_register_menu_link('viewsite', 'admin:view:site', ossn_site_url(), 'topbar_admin');
ossn_register_action('admin/login', ossn_route()->actions . 'administrator/login.php');
ossn_register_action('admin/logout', ossn_route()->actions . 'administrator/logout.php');
if (ossn_isAdminLoggedin()) {
ossn_register_site_settings_page('account', 'pages/account');
ossn_register_action('component/enable', ossn_route()->actions . 'administrator/component/enable.php');
ossn_register_action('component/disable', ossn_route()->actions . 'administrator/component/disable.php');
ossn_register_action('component/delete', ossn_route()->actions . 'administrator/component/delete.php');
ossn_register_action('theme/enable', ossn_route()->actions . 'administrator/theme/enable.php');
ossn_register_action('theme/delete', ossn_route()->actions . 'administrator/theme/delete.php');
ossn_register_action('admin/add/user', ossn_route()->actions . 'administrator/user/add.php');
ossn_register_action('admin/edit/user', ossn_route()->actions . 'administrator/user/edit.php');
ossn_register_action('admin/delete/user', ossn_route()->actions . 'administrator/user/delete.php');
ossn_register_action('admin/validate/user', ossn_route()->actions . 'administrator/user/validate.php');
ossn_register_action('admin/com_install', ossn_route()->actions . 'administrator/component/com_install.php');
ossn_register_action('admin/theme_install', ossn_route()->actions . 'administrator/theme/theme_install.php');
ossn_register_action('admin/settings/save/basic', ossn_route()->actions . 'administrator/settings/save/basic.php');
ossn_register_action('admin/cache/create', ossn_route()->actions . 'administrator/cache/create.php');
ossn_register_action('admin/cache/flush', ossn_route()->actions . 'administrator/cache/flush.php');
}
/*
* Register login and backend pages
*/
if (ossn_isAdminLoggedin()) {
ossn_register_page('administrator', 'ossn_administrator_pagehandler');
ossn_register_site_settings_page('basic', 'settings/admin/basic_settings');
ossn_register_menu_item('topbar_dropdown', array('name' => 'administration', 'text' => ossn_print('admin'), 'href' => ossn_site_url('administrator')));
} else {
ossn_register_page('administrator', 'ossn_administrator_login_pagehandler');
}
}
示例6: input
<?php
/**
* OpenSource-SocialNetwork
*
* @package (Informatikon.com).ossn
* @author OSSN Core Team <info@opensource-socialnetwork.com>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES
* @license General Public Licence http://opensource-socialnetwork.com/licence
* @link http://www.opensource-socialnetwork.com/licence
*/
$photoid = input('id');
$delete = ossn_photos();
$delete->photoid = $photoid;
$photo = $delete->GetPhoto($delete->photoid);
if ($photo->owner_guid == ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) {
if ($delete->deleteProfilePhoto()) {
ossn_trigger_message(ossn_print('photo:deleted:success'), 'success');
redirect();
} else {
ossn_trigger_message(ossn_print('photo:delete:error'), 'error');
redirect();
}
} else {
ossn_trigger_message(ossn_print('photo:delete:error'), 'error');
redirect();
}
示例7: ossn_comment_menu
/**
* Delete comment menu
*
* @return voud;
* @access private
*/
function ossn_comment_menu($name, $type, $params)
{
ossn_unregister_menu('delete', 'comments');
$OssnComment = new OssnComments();
if (is_object($params)) {
$params = get_object_vars($params);
}
$comment = $OssnComment->getComment($params['id']);
if ($comment->type == 'comments:post') {
if (com_is_active('OssnWall')) {
$ossnwall = new OssnWall();
$post = $ossnwall->GetPost($comment->subject_guid);
if (ossn_loggedin_user()->guid == $post->owner_guid) {
ossn_register_menu_link('delete', ossn_print('comment:delete'), array('href' => ossn_site_url("action/delete/comment?comment={$params['id']}"), 'class' => 'ossn-delete-comment'), 'comments');
}
}
}
$user = ossn_loggedin_user();
if (ossn_isLoggedin()) {
if ($user->guid == $params['owner_guid'] || ossn_isAdminLoggedin()) {
ossn_register_menu_link('delete', ossn_print('comment:delete'), array('href' => ossn_site_url("action/delete/comment?comment={$params['id']}"), 'class' => 'ossn-delete-comment'), 'comments');
}
}
}
示例8: ossn_album_photo_menu
/**
* Show a leftside menu on album photo view
*
* @return mix data
* @access private;
*/
function ossn_album_photo_menu($hook, $type, $return, $params)
{
$album = ossn_albums()->getAlbum($params->owner_guid);
if ($album->album->owner_guid == ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) {
return ossn_view('components/OssnPhotos/views/albumphoto/menu', $params);
}
}
示例9: OssnWall
*/
$ossnwall = new OssnWall();
$id = input('post');
$post = $ossnwall->GetPost($id);
if ($post->type == 'user' && !ossn_isAdminLoggedin()) {
if ($post->poster_guid !== ossn_loggedin_user()->guid && $post->owner_guid !== ossn_loggedin_user()->guid) {
if (!ossn_is_xhr()) {
ossn_trigger_message(ossn_print('post:delete:fail'), 'error');
redirect(REF);
} else {
echo 0;
exit;
}
}
}
if ($post->type == 'group' && !ossn_isAdminLoggedin()) {
$group = new OssnGroup();
$group = $group->getGroup($post->owner_guid);
//lastchange group admins are unable to delete member posting on group wall #171
// change or operator to and
if ($post->poster_guid !== ossn_loggedin_user()->guid && ossn_loggedin_user()->guid !== $group->owner_guid) {
if (!ossn_is_xhr()) {
ossn_trigger_message(ossn_print('post:delete:fail'), 'error');
redirect(REF);
} else {
echo 0;
exit;
}
}
}
if ($ossnwall->deletePost($id)) {
示例10: input
<?php
/**
* Open Source Social Network
*
* @packageOpen Source Social Network
* @author Open Social Website Core Team <info@informatikon.com>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES
* @license General Public Licence http://www.opensource-socialnetwork.org/licence
* @link http://www.opensource-socialnetwork.org/licence
*/
$guid = input('guid');
$group = ossn_get_group_by_guid($guid);
if ($group->owner_guid !== ossn_loggedin_user()->guid) {
ossn_trigger_message(ossn_print('group:delete:fail'), 'error');
redirect(REF);
}
if ($group->owner_guid !== ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) {
if ($group->deleteGroup($group->guid)) {
ossn_trigger_message(ossn_print('group:deleted'));
redirect();
} else {
ossn_trigger_message(ossn_print('group:delete:fail'), 'error');
redirect(REF);
}
} else {
ossn_trigger_message(ossn_print('group:delete:fail'), 'error');
redirect(REF);
}
示例11: input
<?php
/**
* OpenSource-SocialNetwork
*
* @package (Informatikon.com).ossn
* @author OSSN Core Team <info@opensource-socialnetwork.com>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES
* @license General Public Licence http://opensource-socialnetwork.com/licence
* @link http://www.opensource-socialnetwork.com/licence
*/
$comment = input('comment');
$delete = new OssnComments();
if ($delete->GetComment($comment)->owner_guid == ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) {
if ($delete->deleteComment($comment)) {
if (ossn_is_xhr()) {
echo 1;
} else {
ossn_trigger_message(ossn_print('comment:deleted'), 'success');
redirect(REF);
}
} else {
if (ossn_is_xhr()) {
echo 0;
} else {
ossn_trigger_message(ossn_print('comment:delete:error'), 'error');
redirect(REF);
}
}
} else {
if (ossn_is_xhr()) {
示例12: OssnComments
$delete = new OssnComments();
$comment = $delete->GetComment($comment);
//group admins must be able to delete ANY comment in their own group #170
//first get wall post then get group and check if loggedin user is group owner
if ($comment->type == 'comments:post') {
$post = ossn_get_object($comment->subject_guid);
if ($post && $post->type == 'group') {
$group = ossn_get_group_by_guid($post->owner_guid);
}
}
$user = ossn_loggedin_user();
if ($comment->type == 'comments:entity') {
$entity = ossn_get_entity($comment->subject_guid);
}
//Post owner can not delete others comments #607
if ($comment->owner_guid == $user->guid || $post->type == 'user' && $user->guid == $post->owner_guid || $group->owner_guid == $user->guid || $entity->owner_guid == $user->guid || ossn_isAdminLoggedin()) {
if ($delete->deleteComment($comment->getID())) {
if (ossn_is_xhr()) {
echo 1;
} else {
ossn_trigger_message(ossn_print('comment:deleted'), 'success');
redirect(REF);
}
} else {
if (ossn_is_xhr()) {
echo 0;
} else {
ossn_trigger_message(ossn_print('comment:delete:error'), 'error');
redirect(REF);
}
}
示例13: canChange
/**
* Can change
* Check if user can change the requested item or not
*
* @param object $user User
* @return boolean
*/
public function canChange($user = '')
{
if (empty($user)) {
$user = ossn_loggedin_user();
}
$allowed = false;
if (isset($user->guid) && $user instanceof OssnUser) {
if (isset($this->owner_guid) && $this->type == 'user' && $this->owner_guid == $user->guid || ossn_isAdminLoggedin()) {
$allowed = true;
}
}
return ossn_call_hook('user', 'can:change', $this, $allowed);
}
示例14: input
<?php
/**
* Open Source Social Network
*
* @package (Informatikon.com).ossn
* @author OSSN Core Team <info@opensource-socialnetwork.org>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES
* @license General Public Licence http://www.opensource-socialnetwork.org/licence
* @link http://www.opensource-socialnetwork.org/licence
*/
$photoid = input('id');
$delete = ossn_photos();
$delete->photoid = $photoid;
$photo = $delete->GetPhoto($delete->photoid);
$owner = ossn_albums();
$owner = $owner->GetAlbum($photo->owner_guid);
if ($owner->album->owner_guid == ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) {
if ($delete->deleteAlbumPhoto()) {
ossn_trigger_message(ossn_print('photo:deleted:success'), 'success');
redirect("album/view/{$owner->album->guid}");
} else {
ossn_trigger_message(ossn_print('photo:delete:error'), 'error');
redirect(REF);
}
} else {
ossn_trigger_message(ossn_print('photo:delete:error'), 'error');
redirect(REF);
}
示例15: deleteAlbum
/**
* Delete Album
*
* @param integer $guid Album Guid
*
* @return boolean
*/
public function deleteAlbum($guid)
{
if (!empty($guid)) {
$album = $this->GetAlbum($guid);
if ($album->album->owner_guid == ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) {
$photos = new OssnPhotos();
foreach ($album->photos as $photo) {
$photos->photoid = $photo->guid;
$photos->deleteAlbumPhoto();
}
if ($album->album->deleteObject()) {
return true;
}
}
}
return false;
}