Admin notices.

If the user's key was successfully added, we need to show an admin notice.

@since 1.8.0
349141
public function admin_notices() {
		$afterKeyAdded = get_option( $this->option );

		if ( empty( $afterKeyAdded ) ) {
			return;
		}

		switch( $afterKeyAdded ) {
			case 'success':
				echo '<div class="notice notice-success is-dismissible bglib-key-added"><p>' .
					esc_html( 'Your new BoldGrid Connect Key has been successfully added!', 'boldgrid-library' ) .
					'</p></div>';
				break;
			case 'fail':
				echo '<div class="notice notice-error is-dismissible bglib-key-added"><p>' .
					esc_html( 'An unknown error occurred adding your new BoldGrid Connect Key.', 'boldgrid-library' ) .
					'</p></div>';
				break;
		}

		delete_option( $this->option );
	}
1279795
public function notifyUser()
    {
        switch ($this->type) {
            case self::TYPE_PASSWORD_RESET:
                $event = new PasswordReset;
                break;
            case self::TYPE_ACTIVATION:
                $event = new UserActivation;
                break;
            case self::TYPE_INVITATION:
                $event = new UserInvitation;
                break;
        }

        $this->user->notify($event);
    }
898580
public function admin_init() {

		// Fix for plugins that *don't do it right* so we don't cause issues for users
		// @codingStandardsIgnoreLine
		if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) ) {
			$pods_admin_ajax_actions = array(
				'pods_admin',
				'pods_relationship',
				'pods_upload',
				'pods_admin_components',
			);

			/**
			 * Admin AJAX Callbacks
			 *
			 * @since unknown
			 *
			 * @param array $pods_admin_ajax_actions Array of actions to handle.
			 */
			$pods_admin_ajax_actions = apply_filters( 'pods_admin_ajax_actions', $pods_admin_ajax_actions );

			if ( in_array( pods_v( 'action' ), $pods_admin_ajax_actions, true ) || in_array( pods_v( 'action', 'post' ), $pods_admin_ajax_actions, true ) ) {
				// @codingStandardsIgnoreLine
				foreach ( $_POST as $key => $value ) {
					if ( 'action' === $key || 0 === strpos( $key, '_podsfix_' ) ) {
						continue;
					}

					// @codingStandardsIgnoreLine
					unset( $_POST[ $key ] );

					// @codingStandardsIgnoreLine
					$_POST[ '_podsfix_' . $key ] = $value;
				}
			}
		}//end if
	}
328491
private function checkIfAdminExists()
    {
        $adminExists = HCUsers::where('email', $this->email)->first();

        if( ! is_null($adminExists) ) {

            $this->checkIfHaveSuperAdminRole($adminExists);

            $this->info('Admin account already exists!');

            if( $this->confirm('Do you want to change its password? [y|N]') ) {
                $this->changePassword($adminExists);
            }

            exit;
        }
    }
185282
public function addLog ( $keys, $received, $sent, $base_string, $notes, $user_id = null )
	{
		if (is_null($user_id) && isset($GLOBALS['any_auth']))
		{
			$user_id = $GLOBALS['any_auth']->getUserId();
		}
		parent::addLog($keys, $received, $sent, $base_string, $notes, $user_id);
	}
299616
protected function createAdminMenu(): void
    {
        $menu = $this->menu();
        $events = $this->app->make('events');

        $handlers = [
            UserMenuHandler::class,
            ExtensionMenuHandler::class,
            SettingMenuHandler::class,
        ];

        $menu->add('home')
            ->title(\trans('orchestra/foundation::title.home'))
            ->link($this->handles('orchestra::/'))
            ->icon('home');

        foreach ($handlers as $handler) {
            $events->listen('orchestra.started: admin', $handler);
        }
    }
227034
function _install_with_new_user() {
            $this->_logger->entrance();

            if ( $this->is_registered() ) {
                return;
            }

            if ( ( $this->is_plugin() && fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) ||
                 // @todo This logic should be improved because it's executed on every load of a theme.
                 $this->is_theme()
            ) {
//				check_admin_referer( $this->_slug . '_activate_new' );

                if ( fs_request_has( 'user_secret_key' ) ) {
                    if ( fs_is_network_admin() && isset( $this->_storage->pending_sites_info ) ) {
                        $pending_sites_info = $this->_storage->pending_sites_info;

                        $this->install_many_pending_with_user(
                            fs_request_get( 'user_id' ),
                            fs_request_get( 'user_public_key' ),
                            fs_request_get( 'user_secret_key' ),
                            fs_request_get_bool( 'is_marketing_allowed', null ),
                            $pending_sites_info['blog_ids'],
                            $pending_sites_info['license_key'],
                            $pending_sites_info['trial_plan_id']
                        );
                    } else {
                        $this->install_with_new_user(
                            fs_request_get( 'user_id' ),
                            fs_request_get( 'user_public_key' ),
                            fs_request_get( 'user_secret_key' ),
                            fs_request_get_bool( 'is_marketing_allowed', null ),
                            fs_request_get( 'install_id' ),
                            fs_request_get( 'install_public_key' ),
                            fs_request_get( 'install_secret_key' ),
                            true,
                            fs_request_get_bool( 'auto_install' )
                        );
                    }
                } else if ( fs_request_has( 'pending_activation' ) ) {
                    $this->set_pending_confirmation( fs_request_get( 'user_email' ), true );
                }
            }
        }
386026
def add_announcement_view(request):
    """"""
    if request.method == "POST":
        form = AnnouncementForm(request.POST)
        logger.debug(form)
        if form.is_valid():
            obj = form.save()
            obj.user = request.user
            # SAFE HTML
            obj.content = safe_html(obj.content)
            obj.save()
            announcement_posted_hook(request, obj)
            messages.success(request, "Successfully added announcement.")
            return redirect("index")
        else:
            messages.error(request, "Error adding announcement")
    else:
        form = AnnouncementForm()
    return render(request, "announcements/add_modify.html", {"form": form, "action": "add"})
31707
public function print_notice_when_no_notifiers_active() {
		if (
			'settings_page_soter' !== get_current_screen()->base
			|| $this->options->email_enabled
			|| $this->options->slack_enabled
		) {
			return;
		}

		echo $this->template->render( 'admin-notice.php', [ // WPCS: XSS OK.
			'type' => 'error',
			'message' => 'All notification channels are currently disabled. Please enable one or more below.',
		] );
	}
1234366
public function isUserAdmin()
	{
		$user = $this->getUsersDatabase();
		$sr = $user->getById($this->_context->authenticatedUserId());
		return ($sr->getField($user->getUserTable()->admin) == "yes");
	}
1104074
private function show_plugin_update_notices() {
		add_action( 'in_plugin_update_message-' . $this->app->define->plugin_base_name, function ( $data, $r ) {
			$new_version = $r->new_version;
			$url         = $this->app->utility->array_get( $data, 'PluginURI' );
			$notices     = $this->get_upgrade_notices( $new_version, $url );
			if ( ! empty( $notices ) ) {
				$this->get_view( 'admin/include/upgrade', [
					'notices' => $notices,
				], true );
			}
		}, 10, 2 );
	}
437363
function options_notice_ignore() {
		global $current_user;
		$user_id = $current_user->ID;
		if ( isset( $_GET['optionsframework_nag_ignore'] ) && '0' == $_GET['optionsframework_nag_ignore'] ) {
			add_user_meta( $user_id, 'optionsframework_ignore_notice', 'true', true );
		}
	}
164073
public function markApproved()
    {
        $this->IsSpam = false;
        $this->Moderated = true;
        $this->write();
        $this->extend('afterMarkApproved');
    }
1116424
def promote
      # add the administrator flag to the selected user.
      if @user.system_admin?
        flash[:warning] = "User #{@user} is already an administrator."
        unless inline_request?
          redirect_to users_path and return
        end
      else
        if @user.update(system_admin: true)
          flash[:success] = "User #{@user} has been promoted to administrator."
        else
          flash[:danger] = "Failed to promote user #{@user}."
        end
      end

      if inline_request?
        render 'show', formats: [ :json ]
      else
        redirect_to users_path
      end
    end
445363
protected function addActions ()
    {
        add_action(Hooks::ADMIN_MENU, array($this, 'addPage'));
        if ($this->currentlyOnPage()) {
            add_action(Hooks::ADMIN_INIT, [$this, 'adminInit']);
        }
    }
906982
public void addUserJarBlobKey(PermanentBlobKey key) {
		if (key == null) {
			throw new IllegalArgumentException();
		}

		if (!userJarBlobKeys.contains(key)) {
			userJarBlobKeys.add(key);
		}
	}
122710
public void notice(String key, String a1) {
        if (quiet) {
            return;
        }
        messager.notice(key, a1);
    }