PluginProbe
ManageWP Worker / 3.9.5
ManageWP Worker v3.9.5
4.9.38 4.9.37 4.9.36 4.9.35 4.9.34 3.8.7 3.8.8 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.22 3.9.23 3.9.24 All 73 releases
worker / user.class.php

user.class.php in ManageWP Worker 3.9.5, at user.class.php

53 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*************************************************************
3 *
4 * user.class.php
5 *
6 * Add Users
7 *
8 *
9 * Copyright (c) 2011 Prelovac Media
10 * www.prelovac.com
11 **************************************************************/
12
13 class MMB_User extends MMB_Core
14 {
15 function __construct()
16 {
17 parent::__construct();
18 }
19
20 function add_user($args)
21 {
22
23 if(!function_exists('username_exists') || !function_exists('email_exists'))
24 include_once(ABSPATH . WPINC . '/registration.php');
25
26 if(username_exists($args['user_login']))
27 return array('error' => 'Username already exists');
28
29 if (email_exists($args['user_email']))
30 return array('error' => 'Email already exists');
31
32 if(!function_exists('wp_insert_user'))
33 include_once (ABSPATH . 'wp-admin/includes/user.php');
34
35 $user_id = wp_insert_user($args);
36
37 if($user_id){
38
39 if($args['email_notify']){
40 //require_once ABSPATH . WPINC . '/pluggable.php';
41 wp_new_user_notification($user_id, $args['user_pass']);
42
43 }
44
45 return $user_id;
46 }else{
47 return array('error' => 'User not added. Please try again.');
48 }
49
50 }
51
52 }
53 ?>