Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Member Restrictions
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
{subpackage}
|
||||
* @since {date}
|
||||
*/
|
||||
|
||||
namespace IPS\{app}\extensions\core\MemberRestrictions;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Member Restrictions
|
||||
*/
|
||||
class _{class} extends \IPS\core\MemberACPProfile\Restriction
|
||||
{
|
||||
/**
|
||||
* Modify Edit Restrictions form
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form The form
|
||||
* @return void
|
||||
*/
|
||||
public function form( \IPS\Helpers\Form $form )
|
||||
{
|
||||
// $form->add( ... );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Form
|
||||
*
|
||||
* @param array $values Values from form
|
||||
* @return array
|
||||
*/
|
||||
public function save( $values )
|
||||
{
|
||||
$return = array();
|
||||
|
||||
// $return['my_restriction'] = array( 'old' => $oldValue, 'new' => $values['my_restriction'] ); // used in changesForHistory()
|
||||
// \IPS\Db::i()->update( ... ); // Actually save the value
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* What restrictions are active on the account?
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function activeRestrictions()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
/*if ( ... )
|
||||
{
|
||||
$return[] = 'my_restricion';
|
||||
}*/
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get details of a change to show on history
|
||||
*
|
||||
* @param array $changes Changes as set in save()
|
||||
* @return array
|
||||
*/
|
||||
public static function changesForHistory( $changes )
|
||||
{
|
||||
$return = array();
|
||||
|
||||
if ( isset( $changes['my_restriction'] ) )
|
||||
{
|
||||
$return[] = \IPS\Member::loggedIn()->language()->addToStack( 'changed_my_restriction', FALSE, array( 'sprintf' => array( $changes['my_restriction']['new'], $changes['my_restriction']['new'] ) ) );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user