]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/RegisterThrottle/RegisterThrottlePlugin.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / plugins / RegisterThrottle / RegisterThrottlePlugin.php
index a049bfc4972e6b29784e6c0e52bc5fd48d616544..d09642a6330872d0206d5a00406674c87ae4a3ee 100644 (file)
@@ -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 $action)
     {
         $ipaddress = $this->_getIpAddress();
 
@@ -158,10 +156,11 @@ class RegisterThrottlePlugin extends Plugin
 
         $reg->user_id   = $profile->id;
         $reg->ipaddress = $ipaddress;
+        $reg->created   = common_sql_now();
 
         $result = $reg->insert();
 
-        if (!$result) {
+        if ($result === false) {
             common_log_db_error($reg, 'INSERT', __FILE__);
             // @todo throw an exception?
         }
@@ -176,7 +175,7 @@ class RegisterThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'RegisterThrottle',
                             'version' => GNUSOCIAL_VERSION,
@@ -242,7 +241,7 @@ class RegisterThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndGrantRole($profile, $role)
+    public function onEndGrantRole(Profile $profile, $role)
     {
         if (!self::$enabled) {
             return true;