Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -14,24 +14,32 @@ namespace IPS\core\modules\front\system;
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use IPS\core\Alerts\Alert;
|
||||
use IPS\Dispatcher\Controller;
|
||||
use IPS\Http\Url;
|
||||
use IPS\Member;
|
||||
use IPS\Output;
|
||||
use IPS\Request;
|
||||
use IPS\Session;
|
||||
use OutOfRangeException;
|
||||
use function defined;
|
||||
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* alerts
|
||||
*/
|
||||
class _alerts extends \IPS\Dispatcher\Controller
|
||||
class alerts extends Controller
|
||||
{
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
public function execute() : void
|
||||
{
|
||||
parent::execute();
|
||||
}
|
||||
@@ -41,26 +49,31 @@ class _alerts extends \IPS\Dispatcher\Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function dismiss()
|
||||
protected function dismiss() : void
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
Session::i()->csrfCheck();
|
||||
|
||||
/* Update user last seen */
|
||||
try
|
||||
{
|
||||
$alert = \IPS\core\Alerts\Alert::load( \IPS\Request::i()->id );
|
||||
$alert = Alert::load( Request::i()->id );
|
||||
|
||||
if( $alert->reply == Alert::REPLY_REQUIRED and \IPS\Member::loggedIn()->member_id and \IPS\Member::loggedIn()->canUseMessenger() and \IPS\Member::load( $alert->member_id )->member_id )
|
||||
if( $alert->reply == 2 and Member::loggedIn()->member_id and Member::loggedIn()->canUseMessenger() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'alert_cant_dismiss', '3C428/1', 403, '' );
|
||||
Output::i()->error( 'alert_cant_dismiss', '3C428/1', 403, '' );
|
||||
}
|
||||
|
||||
$alert->dismiss();
|
||||
}
|
||||
catch( \OutOfRangeException $e ) {}
|
||||
catch( OutOfRangeException $e ) {}
|
||||
|
||||
if ( Request::i()->isAjax() )
|
||||
{
|
||||
Output::i()->json( [ 'message' => 'ok' ] );
|
||||
}
|
||||
|
||||
/* Redirect */
|
||||
\IPS\Output::i()->redirect( base64_decode( \IPS\Request::i()->ref ) );
|
||||
Output::i()->redirect( base64_decode( Request::i()->ref ?: '' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,10 +81,10 @@ class _alerts extends \IPS\Dispatcher\Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function viewReplies()
|
||||
protected function viewReplies() : void
|
||||
{
|
||||
\IPS\core\Alerts\Alert::setAlertCurrentlyFilteringMessages( \IPS\core\Alerts\Alert::load( \IPS\Request::i()->id ) );
|
||||
Alert::setAlertCurrentlyFilteringMessages( Alert::load( Request::i()->id ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=core&module=messaging&controller=messenger&overview=1') );
|
||||
Output::i()->redirect( Url::internal('app=core&module=messaging&controller=messenger&overview=1') );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user