本文整理汇总了PHP中PHPBoostErrors::user_in_read_only方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPBoostErrors::user_in_read_only方法的具体用法?PHP PHPBoostErrors::user_in_read_only怎么用?PHP PHPBoostErrors::user_in_read_only使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPBoostErrors
的用法示例。
在下文中一共展示了PHPBoostErrors::user_in_read_only方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_authorizations
private function check_authorizations()
{
if (!$this->downloadfile->is_authorized_to_delete()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
if (AppContext::get_current_user()->is_readonly()) {
$error_controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($error_controller);
}
}
示例2: check_authorizations
private function check_authorizations()
{
if (!BugtrackerAuthorizationsService::check_authorizations()->moderation() && $this->current_user->get_id() != $this->bug->get_assigned_to_id()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
}
示例3: check_authorizations
private function check_authorizations(ShoutboxMessage $message)
{
if (!$message->is_authorized_to_delete()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
}
示例4: check_authorizations
private function check_authorizations()
{
if (!$this->event->get_content()->is_registration_authorized()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
if (time() > $this->event->get_start_date()->get_timestamp()) {
$error_controller = new UserErrorController(LangLoader::get_message('error', 'status-messages-common'), LangLoader::get_message('calendar.notice.unsuscribe.event_date_expired', 'common', 'calendar'));
DispatchManager::redirect($error_controller);
}
if (AppContext::get_current_user()->is_readonly()) {
$error_controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($error_controller);
}
}
示例5: execute
public function execute(HTTPRequestCustom $request)
{
AppContext::get_session()->csrf_get_protect();
$news = $this->get_news($request);
if (!$news->is_authorized_to_delete()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
NewsService::delete('WHERE id=:id', array('id' => $news->get_id()));
NewsService::get_keywords_manager()->delete_relations($news->get_id());
PersistenceContext::get_querier()->delete(DB_TABLE_EVENTS, 'WHERE module=:module AND id_in_module=:id', array('module' => 'news', 'id' => $news->get_id()));
CommentsService::delete_comments_topic_module('news', $news->get_id());
Feed::clear_cache('news');
AppContext::get_response()->redirect($request->get_url_referrer() ? $request->get_url_referrer() : NewsUrlBuilder::home(), StringVars::replace_vars(LangLoader::get_message('news.message.success.delete', 'common', 'news'), array('name' => $news->get_name())));
}
示例6: check_authorizations
private function check_authorizations()
{
$downloadfile = $this->get_downloadfile();
if ($downloadfile->get_id() === null) {
if (!$downloadfile->is_authorized_to_add()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
} else {
if (!$downloadfile->is_authorized_to_edit()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
}
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
}
示例7: load_module_lang
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
###################################################*/
require_once '../kernel/begin.php';
include_once '../wiki/wiki_functions.php';
load_module_lang('wiki');
$config = WikiConfig::load();
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
define('TITLE', $LANG['wiki_contribuate']);
$bread_crumb_key = 'wiki_post';
require_once '../wiki/wiki_bread_crumb.php';
$is_cat = (int) retrieve(POST, 'is_cat', false);
$is_cat_get = (int) (retrieve(GET, 'type', '') == 'cat');
$is_cat = $is_cat > 0 ? $is_cat : $is_cat_get;
$id_edit = retrieve(POST, 'id_edit', 0);
$title = retrieve(POST, 'title', '');
$encoded_title = retrieve(GET, 'title', '');
$contents = wiki_parse(retrieve(POST, 'contents', '', TSTRING_AS_RECEIVED));
$contents_preview = retrieve(POST, 'contents', '', TSTRING_UNCHANGE);
$id_cat = retrieve(GET, 'id_parent', 0);
$new_id_cat = retrieve(POST, 'id_cat', 0);
示例8: check_authorizations
private function check_authorizations()
{
$message = $this->get_message();
if ($message->get_id() === null) {
if (!GuestbookAuthorizationsService::check_authorizations()->write()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
} else {
if (!$message->is_authorized_edit()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
}
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
}
示例9: check_authorizations
private function check_authorizations()
{
$bug = $this->get_bug();
if ($bug->get_id() === null) {
if (!$bug->is_authorized_to_add()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
} else {
if (!($bug->is_authorized_to_edit() || $bug->get_assigned_to_id() && $this->current_user->get_id() == $bug->get_assigned_to_id())) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
}
if (AppContext::get_current_user()->is_readonly()) {
$error_controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($error_controller);
}
}