Indefero

Indefero Commit Details


Date:2011-02-20 14:23:27 (14 years 2 months ago)
Author:Patrick Georgi
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, release-1.1, release-1.2, release-1.3
Commit:46fda14e08e8936cb5f37bc53f79e3b375b84789
Parents: bbf9ef8b3d859219960e2253ae935dd5fd2aabfc
Message:Make sure no secondary email addresses are used for registration or when changing email address

Changes:

File differences

src/IDF/Form/Register.php
9393
9494
9595
96
97
98
96
9997
10098
10199
    function clean_email()
    {
        $this->cleaned_data['email'] = mb_strtolower(trim($this->cleaned_data['email']));
        $guser = new Pluf_User();
        $sql = new Pluf_SQL('email=%s', $this->cleaned_data['email']);
        if ($guser->getCount(array('filter' => $sql->gen())) > 0) {
        if (Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($this->cleaned_data['email']) != null) {
            throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used. If you need, click on the help link to recover your password.'), $this->cleaned_data['email']));
        }
        return $this->cleaned_data['email'];
src/IDF/Form/UserAccount.php
393393
394394
395395
396
397
398
399
396
397
400398
401399
402400
    function clean_email()
    {
        $this->cleaned_data['email'] = mb_strtolower(trim($this->cleaned_data['email']));
        $guser = new Pluf_User();
        $sql = new Pluf_SQL('email=%s AND id!=%s',
                            array($this->cleaned_data['email'], $this->user->id));
        if ($guser->getCount(array('filter' => $sql->gen())) > 0) {
        $user = Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($this->cleaned_data['email']);
        if ($user != null and $user->id != $this->user->id) {
            throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used.'), $this->cleaned_data['email']));
        }
        return $this->cleaned_data['email'];

Archive Download the corresponding diff file

Page rendered in 0.13977s using 13 queries.