From: Mikael Nordfeldth Date: Fri, 7 Mar 2014 20:01:03 +0000 (+0100) Subject: Cosmetic changes to RegisterThrottle X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=326ad9376e46c61da54052b6d8acf7449da5cdfd;p=quix0rs-gnu-social.git Cosmetic changes to RegisterThrottle --- diff --git a/plugins/RegisterThrottle/RegisterThrottlePlugin.php b/plugins/RegisterThrottle/RegisterThrottlePlugin.php index a049bfc497..251a2b4c79 100644 --- a/plugins/RegisterThrottle/RegisterThrottlePlugin.php +++ b/plugins/RegisterThrottle/RegisterThrottlePlugin.php @@ -28,9 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } /** * Throttle registration by IP address @@ -74,7 +72,7 @@ class RegisterThrottlePlugin extends Plugin * * @return boolean hook value; true means continue processing, false means stop. */ - function onCheckSchema() + public function onCheckSchema() { $schema = Schema::get(); @@ -93,7 +91,7 @@ class RegisterThrottlePlugin extends Plugin * * @return boolean hook value */ - function onStartRegistrationTry($action) + public function onStartRegistrationTry($action) { $ipaddress = $this->_getIpAddress(); @@ -176,7 +174,7 @@ class RegisterThrottlePlugin extends Plugin * * @return boolean hook value */ - function onPluginVersion(&$versions) + public function onPluginVersion(&$versions) { $versions[] = array('name' => 'RegisterThrottle', 'version' => GNUSOCIAL_VERSION, @@ -242,7 +240,7 @@ class RegisterThrottlePlugin extends Plugin * * @return boolean hook value */ - function onEndGrantRole($profile, $role) + public function onEndGrantRole($profile, $role) { if (!self::$enabled) { return true; diff --git a/plugins/RegisterThrottle/classes/Registration_ip.php b/plugins/RegisterThrottle/classes/Registration_ip.php index 431b6c0562..9b28192311 100644 --- a/plugins/RegisterThrottle/classes/Registration_ip.php +++ b/plugins/RegisterThrottle/classes/Registration_ip.php @@ -27,11 +27,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET')) { - exit(1); -} - -require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; +if (!defined('GNUSOCIAL')) { exit(1); } /** * 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 $user_id; // int(4) primary_key not_null - public $ipaddress; // varchar(15) + public $ipaddress; // varchar(45) public $created; // datetime() not_null public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP