Server IP : 104.21.38.3 / Your IP : 162.158.171.21 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/coircraft.com/wp-content/plugins/post-smtp/Postman/ |
Upload File : |
<?php if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if (! class_exists ( 'PostmanMessageHandler' )) { require_once ('PostmanSession.php'); class PostmanMessageHandler { // The Session variables that carry messages const ERROR_CLASS = 'error'; const WARNING_CLASS = 'update-nag'; const SUCCESS_CLASS = 'updated'; private $logger; /** * * @param mixed $options */ function __construct() { $this->logger = new PostmanLogger ( get_class ( $this ) ); // we'll let the 'init' functions run first; some of them may end the request add_action ( 'admin_notices', Array ( $this, 'displayAllMessages' ) ); } /** * * @param mixed $message */ public function addError($message) { $this->storeMessage ( $message, 'error' ); } /** * * @param mixed $message */ public function addWarning($message) { $this->storeMessage ( $message, 'warning' ); } /** * * @param mixed $message */ public function addMessage($message) { $this->storeMessage ( $message, 'notify' ); } /** * store messages for display later * * @param mixed $message * @param mixed $type */ private function storeMessage($message, $type) { $messageArray = array (); $oldMessageArray = PostmanSession::getInstance ()->getMessage (); if ($oldMessageArray) { $messageArray = $oldMessageArray; } $weGotIt = false; foreach ( $messageArray as $storedMessage ) { if ($storedMessage ['message'] === $message) { $weGotIt = true; } } if (! $weGotIt) { $m = array ( 'type' => $type, 'message' => $message ); array_push ( $messageArray, $m ); PostmanSession::getInstance ()->setMessage ( $messageArray ); } } /** * Retrieve the messages and show them */ public function displayAllMessages() { $messageArray = PostmanSession::getInstance ()->getMessage (); if ($messageArray) { PostmanSession::getInstance ()->unsetMessage (); foreach ( $messageArray as $m ) { $type = $m ['type']; switch ($type) { case 'error' : $className = self::ERROR_CLASS; break; case 'warning' : $className = self::WARNING_CLASS; break; default : $className = self::SUCCESS_CLASS; break; } $message = $m ['message']; $this->printMessage ( $message, $className ); } } } /** * putput message * * @param mixed $message * @param mixed $className */ public function printMessage($message, $className) { printf ( '<div class="%s"><p>%s</p></div>', $className, $message ); } } }