← Back to team overview

mahara-contributors team mailing list archive

[Bug 1838908] Re: Email info out of sync

 

Commit hash: c8895712d2053467508c0602421c9cf8b73953d9
Environment tested: Master
Browser tested: Chrome
Theme used:  Raw  

PRECONDITIONS: 
------------------------ 
1) Mahara User19 exists (no roles) (db user ID=20)
2) The following lines of code were added to dummy.php in htdocs to generate emails
<?php
/**
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */

define('INTERNAL', 1);
require('init.php');

if ($USER->is_logged_in()) {
    // we are returning from the SAMl check
    $dummy_username = 'steven' . rand(10000,99999);
    $dummy_email = $dummy_username . '@catalyst.net.nz';

    // set email as non-primary
    set_profile_field($USER->get('id'), 'email', $dummy_email, true);
    $fullname = display_name($USER, null, true);

    $SESSION->add_ok_msg('Add email for ' . $fullname . ' as ' . $dummy_email);
    redirect('/');
}
3) Main URL = http://mahara.stevens-lp.dynamic.wgtn.cat-it.co.nz

TEST STEPS: 
------------------------ 
1) Log in as Mahara User19
2) Browse to /dummy.php
3) Verify that a success message is displayed "Add email for Steve User19 as steven97978@xxxxxxxxxxxxxxx"
4) Browse to /artefact/internal/index.php
5) Verify that the new email address has been added to the users profile addresses
6) Set the new eamil to the default /primary email
7) Browse to the database table - artefact_internal_profile_email 
8) Verify that user ID 20 displays the new email and that the principle column is set to 1 
9) Verify that user ID 20 displays the old email and that the principle column is set to 0 

Catalyst QA Approved ✔


** Attachment added: "db table artefact_internal_profile_email_06-08-19-13:29:41.png"
   https://bugs.launchpad.net/mahara/+bug/1838908/+attachment/5281084/+files/db%20table%20artefact_internal_profile_email_06-08-19-13%3A29%3A41.png

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1838908

Title:
  Email info out of sync

Status in Mahara:
  In Progress

Bug description:
  When adding a non-primary email via:
   set_profile_field($userid, 'email', $email, TRUE);

  we shouldn't set email field in usr table to this new email address
  as the usr.email should be the primary address one

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1838908/+subscriptions


References