Cosmetic changes to RegisterThrottle

This commit is contained in:
Mikael Nordfeldth 2014-03-07 21:01:03 +01:00
parent a35bf227fb
commit 326ad9376e
2 changed files with 7 additions and 13 deletions

View File

@ -28,9 +28,7 @@
* @link http://status.net/ * @link http://status.net/
*/ */
if (!defined('STATUSNET')) { if (!defined('GNUSOCIAL')) { exit(1); }
exit(1);
}
/** /**
* Throttle registration by IP address * Throttle registration by IP address
@ -74,7 +72,7 @@ class RegisterThrottlePlugin extends Plugin
* *
* @return boolean hook value; true means continue processing, false means stop. * @return boolean hook value; true means continue processing, false means stop.
*/ */
function onCheckSchema() public function onCheckSchema()
{ {
$schema = Schema::get(); $schema = Schema::get();
@ -93,7 +91,7 @@ class RegisterThrottlePlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onStartRegistrationTry($action) public function onStartRegistrationTry($action)
{ {
$ipaddress = $this->_getIpAddress(); $ipaddress = $this->_getIpAddress();
@ -176,7 +174,7 @@ class RegisterThrottlePlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onPluginVersion(&$versions) public function onPluginVersion(&$versions)
{ {
$versions[] = array('name' => 'RegisterThrottle', $versions[] = array('name' => 'RegisterThrottle',
'version' => GNUSOCIAL_VERSION, 'version' => GNUSOCIAL_VERSION,
@ -242,7 +240,7 @@ class RegisterThrottlePlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onEndGrantRole($profile, $role) public function onEndGrantRole($profile, $role)
{ {
if (!self::$enabled) { if (!self::$enabled) {
return true; return true;

View File

@ -27,11 +27,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('STATUSNET')) { if (!defined('GNUSOCIAL')) { exit(1); }
exit(1);
}
require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
/** /**
* Data class for storing IP addresses of new registrants. * Data class for storing IP addresses of new registrants.
@ -46,7 +42,7 @@ class Registration_ip extends Managed_DataObject
{ {
public $__table = 'registration_ip'; // table name public $__table = 'registration_ip'; // table name
public $user_id; // int(4) primary_key not_null public $user_id; // int(4) primary_key not_null
public $ipaddress; // varchar(15) public $ipaddress; // varchar(45)
public $created; // datetime() not_null public $created; // datetime() not_null
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP