File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 5
5
use Validator ;
6
6
use October \Rain \Support \ValidationException ;
7
7
use RainLab \User \Models \Settings as UserSettings ;
8
+ use RainLab \User \Models \User ;
8
9
use DMA \Friends \Classes \UserExtend ;
9
10
use DMA \Friends \Models \Usermeta ;
10
11
use DMA \Friends \Wordpress \Auth as WordpressAuth ;
@@ -171,6 +172,19 @@ public function onRegister()
171
172
'content ' => $ this ->makePartial ('register-form ' , [ 'options ' => $ options ]),
172
173
]);
173
174
}
175
+
176
+ /**
177
+ * Verify if the given user mail is not already register
178
+ */
179
+ public function onAvailableUser ()
180
+ {
181
+ $ email = post ('email ' );
182
+ $ data = ['available ' => true ];
183
+ if ( User::where ('email ' , $ email )->count () > 0 ) {
184
+ $ data ['available ' ] = false ;
185
+ }
186
+ return $ data ;
187
+ }
174
188
175
189
/**
176
190
* Submit handler for registration
You can’t perform that action at this time.
0 commit comments