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


PHP error_popup函数代码示例

本文整理汇总了PHP中error_popup函数的典型用法代码示例。如果您正苦于以下问题:PHP error_popup函数的具体用法?PHP error_popup怎么用?PHP error_popup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check() && $this->auth->user()->isRestricted()) {
         return error_popup(trans('errors.no_restricted_access'));
     }
     return $next($request);
 }
开发者ID:Bobo1239,项目名称:osu-web,代码行数:15,代码来源:CheckUserRestricted.php

示例2: update

 public function update($id)
 {
     $order = Store\Order::findOrFail($id);
     if ($order->status !== 'paid') {
         return error_popup("order status {$order->status} is invalid.");
     }
     $order->unguard();
     $order->update(Request::input('order'));
     $order->save();
     return ['message' => "order {$id} updated"];
 }
开发者ID:avail,项目名称:osu-web,代码行数:11,代码来源:OrderController.php

示例3: updateProfileCover

 public function updateProfileCover()
 {
     if (Request::hasFile('cover_file') && !Auth::user()->osu_subscriber) {
         return error_popup(trans('errors.supporter_only'));
     }
     try {
         Auth::user()->profileCustomization()->firstOrCreate([])->setCover(Request::input('cover_id'), Request::file('cover_file'));
     } catch (ImageProcessorException $e) {
         return error_popup($e->getMessage());
     }
     return Auth::user()->defaultJson();
 }
开发者ID:avail,项目名称:osu-web,代码行数:12,代码来源:AccountController.php

示例4: vote

 public function vote($id)
 {
     $discussion = BeatmapDiscussion::findOrFail($id);
     priv_check('BeatmapDiscussionVote', $discussion)->ensureCan();
     $params = get_params(Request::all(), 'beatmap_discussion_vote', ['score:int']);
     $params['user_id'] = Auth::user()->user_id;
     if ($discussion->vote($params)) {
         return $discussion->beatmapsetDiscussion->defaultJson(Auth::user());
     } else {
         return error_popup(trans('beatmaps.discussion-votes.update.error'));
     }
 }
开发者ID:ppy,项目名称:osu-web,代码行数:12,代码来源:BeatmapDiscussionsController.php

示例5: update

 public function update($id)
 {
     $cover = ForumCover::findOrFail($id);
     if (Request::hasFile('cover_file') === true) {
         try {
             $cover = $cover->updateFile(Request::file('cover_file')->getRealPath(), Auth::user());
         } catch (ImageProcessorException $e) {
             return error_popup($e->getMessage());
         }
     }
     return fractal_item_array($cover, new ForumCoverTransformer());
 }
开发者ID:nanaya,项目名称:osu-web,代码行数:12,代码来源:ForumCoversController.php

示例6: register

 public function register($id)
 {
     $tournament = Tournament::findOrFail($id);
     $user = Auth::user();
     if (!$tournament->isRegistrationOpen()) {
         return error_popup('registrations are closed!');
     }
     if (!$tournament->isValidRank($user)) {
         return error_popup('invalid rank!');
     }
     $tournament->register($user);
     return ujs_redirect("/tournaments/{$id}");
 }
开发者ID:echojc,项目名称:osu-web,代码行数:13,代码来源:TournamentsController.php

示例7: update

 public function update($id)
 {
     $cover = TopicCover::findOrFail($id);
     priv_check('ForumTopicCoverEdit', $cover)->ensureCan();
     if (Request::hasFile('cover_file') === true) {
         try {
             $cover = $cover->updateFile(Request::file('cover_file')->getRealPath(), Auth::user());
         } catch (ImageProcessorException $e) {
             return error_popup($e->getMessage());
         }
     }
     return json_item($cover, new TopicCoverTransformer());
 }
开发者ID:ameliaikeda,项目名称:osu-web,代码行数:13,代码来源:TopicCoversController.php

示例8: updateProfileCover

 public function updateProfileCover()
 {
     if (Request::hasFile('cover_file') && !Auth::user()->osu_subscriber) {
         abort(403);
     }
     $customization = Auth::user()->profileCustomization()->firstOrNew([]);
     $customization->setCover($errors, Request::input('cover_id'), Request::file('cover_file'));
     if (count($errors) === 0) {
         return Auth::user()->defaultJson();
     } else {
         return error_popup(implode(',', $errors));
     }
 }
开发者ID:NiHikKi,项目名称:osu-web,代码行数:13,代码来源:AccountController.php

示例9: update

 public function update($orderId, $orderItemId)
 {
     $item = Store\OrderItem::findOrFail($orderItemId);
     if ($item->order_id !== (int) $orderId) {
         return error_popup('invalid order id for this item.');
     }
     if ($item->order->status !== 'paid') {
         return error_popup("order status {$item->order->status} is invalid.");
     }
     $item->unguard();
     $item->update(Request::input('item'));
     $item->save();
     return ['message' => "order item {$orderItemId} updated"];
 }
开发者ID:ppy,项目名称:osu-web,代码行数:14,代码来源:OrderItemsController.php

示例10: login

 public function login()
 {
     $ip = Request::getClientIp();
     $username = Request::input('username');
     $password = Request::input('password');
     $remember = Request::input('remember') === 'yes';
     $user = User::findForLogin($username);
     $authError = User::attemptLogin($user, $password, $ip);
     if ($authError === null) {
         Request::session()->flush();
         Request::session()->regenerateToken();
         Auth::login($user, $remember);
         return ['header' => render_to_string('layout._header_user'), 'header_popup' => render_to_string('layout._popup_user'), 'user' => Auth::user()->defaultJson()];
     } else {
         return error_popup($authError);
     }
 }
开发者ID:ppy,项目名称:osu-web,代码行数:17,代码来源:UsersController.php

示例11: login

 public function login()
 {
     $ip = Request::getClientIp();
     if (LoginAttempt::isLocked($ip)) {
         return error_popup("your IP address is locked. Please wait a few minutes.");
     } else {
         $username = Request::input("username");
         $password = Request::input("password");
         $remember = Request::input("remember") === "yes";
         Auth::attempt(['username' => $username, 'password' => $password], $remember);
         if (Auth::check()) {
             return Auth::user();
         } else {
             LoginAttempt::failedAttempt($ip, $username);
             return error_popup("wrong password or username");
         }
     }
 }
开发者ID:WiiPlayer2,项目名称:osu-web,代码行数:18,代码来源:UsersController.php

示例12: login

 public function login()
 {
     $ip = Request::getClientIp();
     if (LoginAttempt::isLocked($ip)) {
         return error_popup('your IP address is locked. Please wait a few minutes.');
     } else {
         $username = Request::input('username');
         $password = Request::input('password');
         $remember = Request::input('remember') === 'yes';
         Auth::attempt(['username' => $username, 'password' => $password], $remember);
         if (Auth::check()) {
             return Auth::user()->defaultJson();
         } else {
             LoginAttempt::failedAttempt($ip, $username);
             return error_popup('wrong password or username');
         }
     }
 }
开发者ID:avail,项目名称:osu-web,代码行数:18,代码来源:UsersController.php

示例13: postSlackAgree

 public function postSlackAgree()
 {
     $user = Auth::user();
     if ($user->isSlackEligible() === false) {
         return error_popup(trans('errors.community.slack.not-eligible'));
     }
     $token = config('slack.token');
     $contents = file_get_contents("https://osu-public.slack.com/api/users.admin.invite?email={$user->user_email}&token={$token}&set_active=true");
     if ($contents === false) {
         return error_popup(trans('errors.community.slack.slack-error'));
     }
     $contents = json_decode($contents, true);
     if ($contents['ok'] === true) {
         $user->slackUser()->create([]);
         return ['ok' => true];
     } else {
         return error_popup(trans(trans('errors.community.slack.slack-error')));
     }
 }
开发者ID:ameliaikeda,项目名称:osu-web,代码行数:19,代码来源:CommunityController.php

示例14: store

 public function store()
 {
     $discussion = BeatmapDiscussion::findOrNew(Request::input('beatmap_discussion_id'));
     $isNewDiscussion = $discussion->id === null;
     if ($isNewDiscussion) {
         $beatmapsetDiscussion = BeatmapsetDiscussion::where('beatmapset_id', Request::input('beatmapset_id'))->firstOrFail();
         $discussion->beatmapset_discussion_id = $beatmapsetDiscussion->id;
     }
     $posts = [new BeatmapDiscussionPost($this->postParams($discussion))];
     $previousDiscussionResolved = $discussion->resolved;
     $discussion->fill($this->discussionParams($isNewDiscussion));
     priv_check('BeatmapDiscussionPost', $discussion)->ensureCan();
     if ($discussion->resolved === true) {
         priv_check('BeatmapDiscussionResolve', $discussion)->ensureCan();
     }
     if (!$isNewDiscussion && $discussion->resolved !== $previousDiscussionResolved) {
         $posts[] = BeatmapDiscussionPost::generateLogResolveChange(Auth::user(), $discussion->resolved);
     }
     try {
         $saved = DB::transaction(function () use($posts, $discussion) {
             if ($discussion->save() === false) {
                 throw new Exception('failed');
             }
             foreach ($posts as $post) {
                 // done here since discussion may or may not previously exist
                 $post->beatmap_discussion_id = $discussion->id;
                 if ($post->save() === false) {
                     throw new Exception('failed');
                 }
             }
             return true;
         });
     } catch (Exception $_e) {
         $saved = false;
     }
     $postIds = array_pluck($posts, 'id');
     if ($saved === true) {
         return ['beatmapset_discussion' => $posts[0]->beatmapsetDiscussion->defaultJson(Auth::user()), 'beatmap_discussion_post_ids' => $postIds, 'beatmap_discussion_id' => $discussion->id];
     } else {
         return error_popup(trans('beatmaps.discussion-posts.store.error'));
     }
 }
开发者ID:ameliaikeda,项目名称:osu-web,代码行数:42,代码来源:BeatmapDiscussionPostsController.php

示例15: login

 public function login()
 {
     $ip = Request::getClientIp();
     if (LoginAttempt::isLocked($ip)) {
         return error_popup('your IP address is locked. Please wait a few minutes.');
     } else {
         $usernameOrEmail = Request::input('username');
         $user = User::where('username', $usernameOrEmail)->orWhere('user_email', $usernameOrEmail)->first();
         $password = Request::input('password');
         $remember = Request::input('remember') === 'yes';
         $validAuth = $user === null ? false : Auth::getProvider()->validateCredentials($user, compact('password'));
         if ($validAuth) {
             Request::session()->flush();
             Request::session()->regenerateToken();
             Auth::login($user, $remember);
             return ['header' => render_to_string('layout._header_user', ['_user' => Auth::user()]), 'header_popup' => render_to_string('layout._popup_user', ['_user' => Auth::user()]), 'user' => Auth::user()->defaultJson()];
         } else {
             LoginAttempt::failedAttempt($ip, $user);
             return error_popup('wrong password or email');
         }
     }
 }
开发者ID:ameliaikeda,项目名称:osu-web,代码行数:22,代码来源:UsersController.php


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