当前位置: 首页>>代码示例>>PHP>>正文


PHP titania::needs_auth方法代码示例

本文整理汇总了PHP中titania::needs_auth方法的典型用法代码示例。如果您正苦于以下问题:PHP titania::needs_auth方法的具体用法?PHP titania::needs_auth怎么用?PHP titania::needs_auth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在titania的用法示例。


在下文中一共展示了titania::needs_auth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: titania_posting

}
// Output the simple info on the contrib
titania::$contrib->assign_details(true);
if (!titania::$config->support_in_titania && titania::$access_level == TITANIA_ACCESS_PUBLIC) {
    titania::needs_auth();
}
// Handle replying/editing/etc
$posting_helper = new titania_posting();
$posting_helper->act('contributions/contribution_support_post.html', titania::$contrib->contrib_id, titania::$contrib->get_url('support'), TITANIA_SUPPORT);
phpbb::$user->add_lang('viewforum');
if ($topic_id) {
    // Subscriptions
    titania_subscriptions::handle_subscriptions(TITANIA_TOPIC, $topic_id, $topic->get_url());
    // Check access level
    if ($topic->topic_access < titania::$access_level || $topic->topic_type == TITANIA_QUEUE_DISCUSSION && !titania::$contrib->is_author && !titania::$contrib->is_active_coauthor && !titania_types::$types[titania::$contrib->contrib_type]->acl_get('queue_discussion')) {
        titania::needs_auth();
    }
    posts_overlord::display_topic_complete($topic);
    titania::page_header(censor_text($topic->topic_subject) . ' - ' . titania::$contrib->contrib_name);
    if (phpbb::$auth->acl_get('u_titania_post')) {
        phpbb::$template->assign_var('U_POST_REPLY', titania_url::append_url($topic->get_url(), array('action' => 'reply')));
    }
    // Canonical URL
    phpbb::$template->assign_var('U_CANONICAL', $topic->get_url());
} else {
    // Subscriptions
    titania_subscriptions::handle_subscriptions(TITANIA_SUPPORT, titania::$contrib->contrib_id, titania::$contrib->get_url('support'));
    // Mark all topics read
    if (request_var('mark', '') == 'topics') {
        titania_tracking::track(TITANIA_SUPPORT, titania::$contrib->contrib_id);
    }
开发者ID:Gfksx,项目名称:customisation-db,代码行数:31,代码来源:support.php

示例2: common_delete

 private function common_delete($post_id, $undelete = false)
 {
     titania::add_lang('posting');
     phpbb::$user->add_lang('posting');
     // Load the stuff we need
     $post_object = $this->load_post($post_id);
     // Check permissions
     if (!$undelete && !$post_object->acl_get('delete') || $undelete && !$post_object->acl_get('undelete')) {
         titania::needs_auth();
     }
     if (titania::confirm_box(true)) {
         if (!$undelete) {
             $redirect_post_id = false;
             // Delete the post
             if (isset($_POST['hard_delete']) || $post_object->post_deleted) {
                 if (!phpbb::$auth->acl_get('u_titania_post_hard_delete')) {
                     titania::needs_auth();
                 }
                 $post_object->hard_delete();
                 // Try to redirect to the next or previous post
                 $redirect_post_id = posts_overlord::next_prev_post_id($post_object->topic_id, $post_object->post_id);
                 if ($redirect_post_id) {
                     redirect(titania_url::append_url($post_object->topic->get_url(), array('p' => $redirect_post_id, '#p' => $redirect_post_id)));
                 }
                 redirect(titania_url::build_url($post_object->topic->topic_url));
             } else {
                 $post_object->soft_delete();
                 if (phpbb::$auth->acl_get('u_titania_mod_post_mod')) {
                     // They can see the post, redirect back to it
                     redirect($post_object->get_url());
                 } else {
                     // They cannot see the post, try to redirect to the next or previous post
                     $redirect_post_id = posts_overlord::next_prev_post_id($post_object->topic_id, $post_object->post_id);
                     if ($redirect_post_id) {
                         redirect(titania_url::append_url($post_object->topic->get_url(), array('p' => $redirect_post_id, '#p' => $redirect_post_id)));
                     }
                 }
             }
             redirect($post_object->topic->get_url());
         } else {
             $post_object->undelete();
             redirect($post_object->get_url());
         }
     } else {
         phpbb::$template->assign_var('S_HARD_DELETE', !$undelete && !$post_object->post_deleted && phpbb::$auth->acl_get('u_titania_post_hard_delete') ? true : false);
         titania::confirm_box(false, !$undelete ? 'DELETE_POST' : 'UNDELETE_POST', '', array(), 'posting/delete_confirm.html');
     }
     redirect($post_object->get_url());
 }
开发者ID:kairion,项目名称:customisation-db,代码行数:49,代码来源:posting.php


注:本文中的titania::needs_auth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。