当前位置: 首页>>代码示例>>PHP>>正文


PHP user::add方法代码示例

本文整理汇总了PHP中user::add方法的典型用法代码示例。如果您正苦于以下问题:PHP user::add方法的具体用法?PHP user::add怎么用?PHP user::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在user的用法示例。


在下文中一共展示了user::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addRequest

 /**
  * Adds a request in the DB
  *
  * @return string salt
  */
 function addRequest($handle, $email, $firstName, $lastName, $pw1, $pw2)
 {
     $data = array('handle' => $handle, 'firstname' => $firstName, 'lastname' => $lastName, 'email' => $email, 'password' => $pw1, 'password2' => $pw2, 'purpose' => 'vote in general election', 'fromt_site' => SITE, 'moreinfo' => '', 'homepage' => '');
     include_once 'pear-database-user.php';
     $useradd = user::add($data, false, true);
     if (is_array($useradd) || DB::isError($useradd)) {
         return $useradd;
     }
     $salt = $this->_makeSalt($handle);
     $created_on = gmdate('Y-m-d');
     $query = '
     INSERT INTO election_account_request (created_on, handle, email, salt)
     VALUES (?, ?, ?, ?)';
     $res = $this->dbh->query($query, array($created_on, $handle, $email, $salt));
     if (DB::isError($res)) {
         user::remove($handle);
         return $res;
     }
     //$this->find($salt);
     //$this->sendRequest();
     return $salt;
 }
开发者ID:stof,项目名称:pearweb,代码行数:27,代码来源:pear-election-accountrequest.php

示例2: add

 /**
 	Adds a new user	*/
 public function add()
 {
     global $__in, $__out;
     $user = new user();
     if ($__in['__is_form_submitted']) {
         // if form is submitted
         try {
             $user->add($__in['user']);
             return dispatcher::redirect("getall", "added_successfully");
         } catch (ValidationException $ex) {
             $ex->publish_errors();
             $__out['user'] = $__in['user'];
             return false;
         } catch (Exception $ex) {
             throw $ex;
         }
     } else {
         // if form is not submitted
         $__out['user'] = array();
         return true;
     }
     // end if form submitted
 }
开发者ID:halaby,项目名称:smlite-framework,代码行数:25,代码来源:useradmin_controller.php

示例3: rand

                            $pixelG = $pixelRGB >> 8 & 0xff;
                            $pixelB = $pixelRGB & 0xff;
                            if ($pixelB) {
                                $sectorType = 0;
                                $sectorId = rand(1, 4);
                            } else {
                                if ($pixelG) {
                                    $sectorType = 1;
                                    $sectorId = rand(1, 10);
                                }
                            }
                            array_push($query, '(' . $i . ', ' . $j . ', ' . $sectorType . ', ' . $sectorId . ')');
                        }
                    }
                    $db->query('insert into grid (x, y, type, id) values ' . implode(', ', $query));
                    $user->add();
                    $message = $ui['installed'];
                } else {
                    $message = $ui['nameTaken'];
                }
            } else {
                $message = $ui['wrongCode'];
            }
        } else {
            $message = $ui['rePassNotMatch'];
        }
    } else {
        $message = $ui['insufficientData'];
    }
} else {
    $_SESSION['regCode'] = rand(1, 9999);
开发者ID:yunsite,项目名称:devana-heroic,代码行数:31,代码来源:install.php

示例4: user_handler

 function user_handler()
 {
     $this->check_login();
     $params = $this->input->post();
     if (isset($params['save'])) {
         user::add($params);
     }
     redirect('admin/users');
 }
开发者ID:pojok-webdev,项目名称:pattimura,代码行数:9,代码来源:admin.php

示例5: addPeople

 private function addPeople($peopleArray)
 {
     $user = new user();
     foreach ($peopleArray->person as $person) {
         $company = 0;
         //note that this should be updated when company becomes a used object
         $isAdmin = 1;
         $rolesobj = new roles();
         $adminrid = $rolesobj->add("BasecampAdmin", array("add" => 1, "edit" => 1, "del" => 1, "close" => 1), array("add" => 1, "edit" => 1, "del" => 1, "close" => 1), array("add" => 1, "edit" => 1, "del" => 1, "close" => 1), array("add" => 1, "edit" => 1, "del" => 1, "close" => 1), array("add" => 1, "edit" => 1, "del" => 1), array("add" => 1, "edit" => 1, "del" => 1, "read" => 1), array("add" => 0), array("add" => 1));
         $userrid = $rolesobj->add("BasecampUser", array("add" => 1, "edit" => 1, "del" => 0, "close" => 0), array("add" => 1, "edit" => 1, "del" => 0), array("add" => 1, "edit" => 1, "del" => 1), array("add" => 1, "edit" => 1, "del" => 1), array("add" => 1, "edit" => 1, "del" => 1), array("add" => 1, "edit" => 1, "del" => 1, "read" => 0), array("add" => 1), array("add" => 0));
         $username = $person->{'user-name'};
         $email = $person->{'email-address'};
         $pass = $email;
         $uid = $user->add($username, $email, $company, $pass);
         if ($uid) {
             if ($person->{'administrator'} == "true") {
                 $rolesobj->assign($adminrid, $uid);
                 $isAdmin = 5;
             } elseif ($person->{'client-id'} != 0) {
                 $rolesobj->assign($userrid, $uid);
                 $isAdmin = 0;
             }
             $iid = "" . $person->{'id'};
             $this->peopleHash[$iid] = $uid;
             ++$this->peopleCount;
         }
     }
 }
开发者ID:janvalentik,项目名称:Collabtive,代码行数:28,代码来源:class.importer.php

示例6: onDoSignupBtn

 function onDoSignupBtn($info)
 {
     if ($info['email'] != "" && $info['password'] != "" && $info['passwordagain'] != "") {
         $u = new user("");
         $signup = $u->add($info['email'], $info['password'], $info['passwordagain'], $info['userName'], $info['Address'], $info['Country'], $info['PostalCode'], 'user');
         switch ($signup) {
             case 1:
                 //All set - user added and logged in!
                 $this->msg = "Please Check Your email!";
                 $this->_bookframe("frmMain");
                 break;
             case -1:
                 //user already exist
                 $this->msg = "user already exist";
                 $this->_bookframe("frmMain");
                 break;
             case -2:
                 //passwords didn't match...
                 $this->msg = "passwords didn't match...";
                 $this->_bookframe("frmMain");
                 break;
             default:
                 osLog('viewslogin', $this->_fullname, "##### weird...");
                 $this->_bookframe("frmMain");
                 break;
         }
     }
 }
开发者ID:rezamoussavi,项目名称:MouRe,代码行数:28,代码来源:viewslogin.php

示例7: confirmRequest

 function confirmRequest($handle, $password, $name)
 {
     $sql = 'SELECT handle FROM users WHERE handle = ?';
     if ($handle == $this->dbh->getOne($sql, array($handle))) {
         $id = $this->dbh->nextId("karma");
         $query = 'INSERT INTO karma VALUES (?, ?, ?, ?, NOW())';
         $sth = $this->dbh->query($query, array($id, $this->handle, 'pear.bug', 'pearweb'));
         return true;
     }
     list($firstname, $lastname) = explode(' ', $name, 2);
     $data = array('handle' => $handle, 'firstname' => $firstname, 'lastname' => $lastname, 'email' => $this->email, 'purpose' => 'bug tracker', 'password' => $password, 'password2' => $password, 'purpose' => 'Open/Comment on bugs', 'moreinfo' => 'Automatic Account Request', 'homepage' => '');
     include_once 'pear-database-user.php';
     $useradd = user::add($data, true, true);
     if ($useradd !== true) {
         return $useradd;
     }
     $sql = 'SELECT handle from bug_account_request WHERE salt = ?';
     $temphandle = $this->dbh->getOne($sql, array($this->salt));
     // update all relevant records to the new handle
     $this->dbh->query('UPDATE bugdb_comments set reporter_name = ? WHERE handle = ?', array($name, $temphandle));
     $this->dbh->query('UPDATE bugdb set reporter_name = ? WHERE handle = ?', array($name, $temphandle));
     $this->dbh->query('UPDATE users set handle = ? WHERE handle = ?', array($handle, $temphandle));
     $this->dbh->query('UPDATE bugdb set registered = 1, handle = ? WHERE handle = ?', array($handle, $temphandle));
     $this->dbh->query('UPDATE bugdb_comments set handle = ? WHERE handle = ?', array($handle, $temphandle));
     $this->dbh->query('UPDATE bugdb_patchtracker set developer = ? WHERE developer = ?', array($handle, $temphandle));
     $this->handle = $handle;
     // activate the handle and grant karma
     // implicitly without human intervention
     // copied from the user class and Damblan_Karma
     include_once 'pear-database-user.php';
     $user = user::info($handle, null, 0);
     if (!isset($user['registered'])) {
         return false;
     }
     @($arr = unserialize($user['userinfo']));
     include_once 'pear-database-note.php';
     note::removeAll($handle);
     $data = array();
     $data['registered'] = 1;
     $data['password'] = $password;
     $data['name'] = $name;
     if (is_array($arr)) {
         $data['userinfo'] = $arr[1];
     }
     $data['create'] = gmdate('Y-m-d');
     $data['createBy'] = SITE . 'web';
     $data['handle'] = $handle;
     user::update($data, true);
     $query = 'INSERT INTO karma VALUES (?, ?, ?, ?, NOW())';
     $id = $this->dbh->nextId('karma');
     $sth = $this->dbh->query($query, array($id, $this->handle, 'pear.bug', SITE . 'web'));
     $id = $this->dbh->nextId('karma');
     $sth = $this->dbh->query($query, array($id, $this->handle, 'pear.voter', SITE . 'web'));
     if (!DB::isError($sth)) {
         require_once 'bugs/pear-bugs-utils.php';
         $pbu = new PEAR_Bugs_Utils();
         note::add($this->handle, 'Account opened', SITE . 'web');
         $bugs = $this->dbh->getAll('SELECT * FROM bugdb WHERE handle = ?', array($this->handle), DB_FETCHMODE_ASSOC);
         foreach ($bugs as $bug) {
             $this->sendBugEmail($bug);
         }
         $patches = $this->dbh->getAll('SELECT bugdb.package_name, bugdb_patchtracker.*
             FROM bugdb_patchtracker, bugdb
             WHERE bugdb_patchtracker.developer = ?
                 AND bugdb.id = bugdb_patchtracker.bugdb_id', array($this->handle), DB_FETCHMODE_ASSOC);
         foreach ($patches as $patch) {
             $pbu->sendPatchEmail($patch);
         }
         $bugs = $this->dbh->getAll('SELECT bugdb_comments.email,bugdb_comments.comment,
                 bugdb_comments.reporter_name, bugdb.id,
                 bugdb.bug_type,bugdb.package_name,bugdb.sdesc,
                 bugdb.ldesc,bugdb.php_version, bugdb.php_os,bugdb.status,
                 bugdb.assign,bugdb.package_version
              FROM bugdb_comments, bugdb
              WHERE bugdb.id = bugdb_comments.bug AND
              bugdb_comments.handle = ?', array($this->handle), DB_FETCHMODE_ASSOC);
         foreach ($bugs as $bug) {
             $this->sendBugCommentEmail($bug);
         }
         $msg = "Your PEAR bug tracker account has been opened.\n" . "Bugs you have opened will now be displayed, and you can\n" . "add new comments to existing bugs";
         $xhdr = "From: " . PEAR_WEBMASTER_EMAIL;
         if (!DEVBOX) {
             mail($user['email'], "Your PEAR Bug Tracker Account Request", $msg, $xhdr, "-f " . PEAR_BOUNCE_EMAIL);
         }
         $this->deleteRequest();
         return true;
     }
     return false;
 }
开发者ID:stof,项目名称:pearweb,代码行数:89,代码来源:pear-bug-accountrequest.php

示例8: insert

 function insert()
 {
     $response = $this->get_response('insert');
     $form = $response->form;
     if (!$form->get_errors() && $response->submit()) {
         $user = $form->get_request('user');
         $ini = $user;
         unset($ini['pass2']);
         if (isset($user['user_password']) && !isset($user['pass2']) || isset($user['user_password']) && $user['user_password'] !== $user['pass2']) {
             $form->set_error('user[pass2]', sprintf($this->lang['error_no_match'], $this->lang['password_repeat'], $this->lang['password']));
         }
         if (!$form->get_errors()) {
             $check = new user($user['user_name']);
             // Check user exists
             if (!$check->check_user_exists()) {
                 global $USER_INFO_TABLE;
                 $ini['user_id'] = (int) str_replace(".", "", str_pad(microtime(true), 15, "0"));
                 $check->add($ini);
                 $pass = new user($ini['user_name']);
                 $pass->change_htpasswd('insert');
             } else {
                 $form->set_error('user[user_name]', sprintf($this->lang['error_user_exists'], $user['user_name']));
                 $error = sprintf($this->lang['error_user_exists'], $user['user_name']);
             }
             if (!isset($error) || $error === '') {
                 $response->msg = sprintf($this->lang['msg_saved'], $user['user_name']);
             } else {
                 $response->error = $error;
             }
         } else {
             $response->error = join('<br>', $form->get_errors());
         }
     }
     if ($form->get_errors()) {
         $response->error = join('<br>', $form->get_errors());
     }
     return $response;
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:38,代码来源:user.users.class.php

示例9: cm_moodle_user_to_cm

/**
 * Migrate a single Moodle user to the Curriculum Management system.  Will
 * only do this for users who have an idnumber set.
 */
function cm_moodle_user_to_cm($mu)
{
    global $CURMAN, $CFG;
    require_once CURMAN_DIRLOCATION . '/lib/customfield.class.php';
    require_once CURMAN_DIRLOCATION . '/lib/user.class.php';
    require_once $CFG->dirroot . '/user/profile/lib.php';
    // re-fetch, in case this is from a stale event
    $mu = addslashes_recursive($CURMAN->db->get_record('user', 'id', $mu->id));
    if (empty($mu->idnumber) && $CURMAN->config->auto_assign_user_idnumber) {
        $mu->idnumber = $mu->username;
        $CURMAN->db->update_record('user', $mu);
    }
    if (empty($mu->idnumber)) {
        return true;
    } else {
        if (empty($mu->country)) {
            //this is necessary because PM requires this field
            return true;
        } else {
            if ($cu = $CURMAN->db->get_record('crlm_user', 'idnumber', $mu->idnumber)) {
                $cu = new user(addslashes_recursive($cu));
                // synchronize any profile changes
                $cu->username = $mu->username;
                $cu->password = $mu->password;
                $cu->idnumber = $mu->idnumber;
                $cu->firstname = $mu->firstname;
                $cu->lastname = $mu->lastname;
                $cu->email = $mu->email;
                $cu->address = $mu->address;
                $cu->city = $mu->city;
                $cu->country = $mu->country;
                $cu->phone = empty($mu->phone1) ? empty($cu->phone) ? '' : $cu->phone : $mu->phone1;
                $cu->phone2 = empty($mu->phone2) ? empty($cu->phone2) ? '' : $cu->phone2 : $mu->phone2;
                $cu->language = empty($mu->lang) ? empty($cu->language) ? '' : $cu->language : $mu->lang;
                $cu->timemodified = time();
                // synchronize custom profile fields
                profile_load_data($mu);
                $fields = field::get_for_context_level(context_level_base::get_custom_context_level('user', 'block_curr_admin'));
                $fields = $fields ? $fields : array();
                require_once CURMAN_DIRLOCATION . '/plugins/moodle_profile/custom_fields.php';
                foreach ($fields as $field) {
                    $field = new field($field);
                    if (isset($field->owners['moodle_profile']) && $field->owners['moodle_profile']->exclude == cm_moodle_profile::sync_from_moodle) {
                        $fieldname = "field_{$field->shortname}";
                        $cu->{$fieldname} = $mu->{"profile_field_{$field->shortname}"};
                    }
                }
                $cu->update();
            } else {
                $cu = new user();
                $cu->username = $mu->username;
                $cu->password = $mu->password;
                $cu->idnumber = $mu->idnumber;
                $cu->firstname = $mu->firstname;
                $cu->lastname = $mu->lastname;
                $cu->email = $mu->email;
                $cu->address = $mu->address;
                $cu->city = $mu->city;
                $cu->country = $mu->country;
                $cu->phone = $mu->phone1;
                $cu->phone2 = $mu->phone2;
                $cu->language = $mu->lang;
                $cu->transfercredits = 0;
                $cu->timecreated = $cu->timemodified = time();
                // synchronize profile fields
                profile_load_data($mu);
                $fields = field::get_for_context_level(context_level_base::get_custom_context_level('user', 'block_curr_admin'));
                $fields = $fields ? $fields : array();
                require_once CURMAN_DIRLOCATION . '/plugins/moodle_profile/custom_fields.php';
                foreach ($fields as $field) {
                    $field = new field($field);
                    if (isset($field->owners['moodle_profile']) && $field->owners['moodle_profile']->exclude == cm_moodle_profile::sync_from_moodle) {
                        $fieldname = "field_{$field->shortname}";
                        $cu->{$fieldname} = $mu->{"profile_field_{$field->shortname}"};
                    }
                }
                $cu->add();
            }
        }
    }
    return true;
}
开发者ID:remotelearner,项目名称:elis.cm,代码行数:86,代码来源:lib.php

示例10: mkdir

 mkdir(CL_ROOT . "/files/" . CL_CONFIG . "/");
 mkdir(CL_ROOT . "/files/" . CL_CONFIG . "/avatar/", 0777);
 mkdir(CL_ROOT . "/files/" . CL_CONFIG . "/ics/", 0777);
 require CL_ROOT . "/config/" . CL_CONFIG . "/config.php";
 // Start database connection
 $conn = new PDO("mysql:host={$db_host};dbname={$db_name}", $db_user, $db_pass);
 $user = $_POST['name'];
 $pass = $_POST['pass'];
 // create the first user
 $usr = new user();
 $installChk = $usr->getAllUsers();
 if ($installChk) {
     // There already are users. abort install.
     die("Collabtive seems to be already installed.<br />If this is an error, please clear your database.");
 }
 $usrid = $usr->add($user, "", 0, $pass);
 if (!$usrid) {
     $template->assign("errortext", "Error: Failed to create first user.");
     $template->display("error.tpl");
     die;
 }
 // insert default roles
 $rolesobj = new roles();
 $adminrid = $rolesobj->add("Admin", array("add" => 1, "edit" => 1, "del" => 1, "close" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "close" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "close" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "close" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "read" => 1, "view" => 1), array("add" => 1), array("add" => 1));
 $userrid = $rolesobj->add("User", array("add" => 1, "edit" => 1, "del" => 0, "close" => 0, "view" => 1), array("add" => 1, "edit" => 1, "del" => 0, "close" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "close" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "close" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "view" => 1), array("add" => 1, "edit" => 1, "del" => 1, "read" => 0, "view" => 1), array("add" => 1), array("add" => 0));
 $clientrid = $rolesobj->add("Client", array("add" => 0, "edit" => 0, "del" => 0, "close" => 0), array("add" => 0, "edit" => 0, "del" => 0, "close" => 0), array("add" => 0, "edit" => 0, "del" => 0, "close" => 0), array("add" => 0, "edit" => 0, "del" => 0, "close" => 0), array("add" => 0, "edit" => 0, "del" => 0), array("add" => 0, "edit" => 0, "del" => 0, "read" => 0), array("add" => 0), array("add" => 0));
 if (!$adminrid or !$userrid or !$clientrid) {
     $template->assign("errortext", "Error: Failed to create initial roles.");
     $template->display("error.tpl");
     die;
 }
开发者ID:Setrino,项目名称:collabtive,代码行数:31,代码来源:install.php

示例11: isset

 }
 if (!isset($stripped['captcha']) || !isset($_SESSION['answer']) || $stripped['captcha'] != $_SESSION['answer']) {
     $errors[] = 'Incorrect CAPTCHA';
     $display_form = true;
 }
 $p = isset($stripped['existingpackage']) ? $stripped['existingpackage'] : '';
 $package = $dbh->getOne('SELECT count(id) FROM packages WHERE packages.name = ?', array($p));
 if (!$package) {
     $errors[] = 'Package "' . htmlspecialchars($p) . '" does not ' . 'exist, please choose a pre-existing package name';
 }
 if ($errors) {
     break;
 }
 //  The add method performs further validation then creates the account
 include_once 'pear-database-user.php';
 $ok = user::add($stripped);
 if (PEAR::isError($ok)) {
     $errors[] = 'This email address has already been registered by another user';
     $display_form = true;
     break;
 }
 if (isset($stripped['display_form'])) {
     $display_form = $stripped['display_form'];
 }
 if (is_array($ok)) {
     $errors = $ok;
     break;
 } elseif ($ok === true) {
     report_success('Your account request has been submitted, it will' . ' be reviewed by a human shortly.  This may take from' . ' two minutes to several days, depending on how much' . ' time people have.' . ' You will get an email when your account is open,' . ' or if your request was rejected for some reason.');
     $mailData = array('username' => $stripped['handle'], 'firstname' => $stripped['firstname'], 'lastname' => $stripped['lastname'], 'package' => $stripped['existingpackage']);
     if (!DEVBOX) {
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:account-request-existingpackage.php

示例12: elseif

            }
            $i2 = $i2 + 1;
        }
    }
    $title = $langfile['useradministration'];
    $template->assign("title", $title);
    SmartyPaginate::assign($template);
    $template->assign("users", $users);
    $template->assign("projects", $projects);
    $template->assign("roles", $roles);
    $template->display("adminusers.tpl");
} elseif ($action == "adduser") {
    // Get the system locale and set it as the default locale for the new user
    $sysloc = $settings["locale"];
    // Add the user
    $newid = $user->add($name, $email, $company, $pass, $sysloc, $tags, $rate);
    //user has been created successfully
    if ($newid) {
        //are there projects the userd should be assigned to
        if (!empty($assignto)) {
            // Assign the user to all selected projects
            foreach ($assignto as $proj) {
                $project->assign($newid, $proj);
            }
        }
        $roleobj = (object) new roles();
        $roleobj->assign($role, $newid);
        if ($settings["mailnotify"]) {
            if (!empty($email)) {
                $subject = $langfile["profileaddedsubject"] . ' (' . $langfile['by'] . ' ' . $username . ')';
                $mailcontent = $langfile["hello"] . ",<br /><br/>" . $langfile["profileaddedtext"] . "<br /><br />" . $langfile["profileusername"] . ":&nbsp;" . "{$name}<br />" . $langfile["profilepass"] . ":&nbsp;" . "{$pass}<br /><br />" . "<a href = \"{$url}\">{$url}</a>";
开发者ID:veganaize,项目名称:Collabtive,代码行数:31,代码来源:admin.php

示例13: user

 /**
  * Sign up a new user ready for confirmation.
  * Password is passed in plaintext.
  *
  * @param object $user new user object (with system magic quotes)
  * @param boolean $notify print notice with link and terminate
  */
 function user_signup($user, $notify = true)
 {
     global $CFG;
     require_once $CFG->dirroot . '/user/profile/lib.php';
     /// Create a new curriculum user.
     $curuser = new user($user);
     //        $curuser->generate_password();
     /// Calculate the birthdate.
     //        $curuser->birthdate = (sprintf('%04d', $user->birthdate['year'])) . '/' .
     //                              (sprintf('%02d', $user->birthdate['month'])) . '/' .
     //                              (sprintf('%02d', $user->birthdate['day']));
     /// Create a new Moodle user from the user object passed in.
     $moodleuser = new Object();
     $moodleuser = clone $user;
     /// Modify the Moodle user with any curriculum user data.
     $moodleuser->username = $curuser->username;
     $moodleuser->password = $curuser->password;
     $moodleuser->password = hash_internal_user_password($moodleuser->password);
     $moodleuser->idnumber = $curuser->idnumber = $curuser->username;
     $moodleuser->timemodified = time();
     //** TODO - Fix email validation **//
     /// Validate the email address.
     if (!validate_email($curuser->email)) {
         if (!validate_email($curuser->email2)) {
             $moodleuser->email = 'none@email.com';
             /// This will only happen if both are set to "none" (see '/blocks/curr_admin/customscripts/login/signup_form.php').
         } else {
             $moodleuser->email = $user->email2;
         }
     } else {
         $moodleuser->email = $curuser->email;
     }
     if (!($user->id = insert_record('user', $moodleuser))) {
         print_error('auth_emailnoinsert', 'auth');
     }
     /// Save any custom profile field information
     profile_save_data($user);
     $curuser->email2 = $curuser->contactemail = $user->email2;
     if (!$curuser->add()) {
         print_error('curr_usernotcreated', 'curr');
     }
     /// Assign them to the default curriculum (*** MAKE THIS CONFIGURABLE ***)
     //        $curuser->assign_curriculum(array('idnumber' => 'CRS'));
     if (!$curuser->send_confirmation_email($this->config->crlm_fromemail, $this->config->crlm_emailadmins)) {
         print_error('auth_emailnoemail', 'auth');
     }
     if ($notify) {
         $emailconfirm = get_string('emailconfirm');
         $navlinks = array();
         $navlinks[] = array('name' => $emailconfirm, 'link' => null, 'type' => 'misc');
         $navigation = build_navigation($navlinks);
         print_header($emailconfirm, $emailconfirm, $navigation);
         $notice = new Object();
         $notice->email = $user->email;
         $this->notice(get_string('emailconfirmsent', 'auth_crlm', $notice), $CFG->wwwroot);
     } else {
         return true;
     }
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:66,代码来源:auth.php

示例14: addUser

 public function addUser(User $user)
 {
     $this->users->add($user);
     $user->setUniversite($this);
     return $this;
 }
开发者ID:ESNFranceG33kTeam,项目名称:sf_buddysystem,代码行数:6,代码来源:Univercity.php

示例15: session_start

<?php

session_start();
if (!isset($_SESSION['user'])) {
    header('location: login.php');
}
require_once 'include/clases.php';
if (isset($_POST["altausuario"])) {
    if ($_SESSION['tipo'] == 'ADM') {
        user::add($_POST["nombre"], $_POST["apellido"], $_POST["email"], $_POST["username"], $_POST["pass1"], $_POST["pass2"], @$_POST["adm"]);
    }
    var_dump(msg::get());
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script style="color: rgb(0, 0, 0);" src="js/jquery-1.11.1.min.js"></script>
<!---<script src="https://code.jquery.com/jquery-1.10.2.js"></script>--->
     <script src="js/functions.js"></script>
     <script src="js/colors.js"></script>
    <script src="js/funciones.js"></script>
    <script src="js/switchery.min.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="css/styles-form.css">
    <link rel="stylesheet" type="text/css" media="all" href="css/switchery.min.css">
    
<link href="css/style.css" rel="stylesheet" type="text/css" media="all">
<link href="css/estilo.css" rel="stylesheet" type="text/css" media="all">
    
<title>[StockMGR]</title>
<link rel="icon" 
开发者ID:StockersSRL,项目名称:Lucas,代码行数:31,代码来源:alta_usuario.php


注:本文中的user::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。