[svn r13895] Added update of openid to admin user_edit interface

skala
Yannick Warnier 17 years ago
parent e99610cf91
commit 7d32354de2
  1. 12
      main/admin/user_edit.php
  2. 14
      main/inc/lib/usermanager.lib.php

@ -1,4 +1,4 @@
<?php // $Id: user_edit.php 13536 2007-10-18 16:58:58Z yannoo $
<?php // $Id: user_edit.php 13895 2007-12-03 21:54:45Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
@ -99,6 +99,12 @@ $form->addElement('text', 'email', get_lang('Email'),array('size' => '40'));
$form->addRule('email', get_lang('EmailWrong'), 'email');
$form->addRule('email', get_lang('EmailWrong'), 'required');
// OpenID
if(api_get_setting('openid_authentication')=='true')
{
$form->addElement('text', 'openid', get_lang('OpenIDURL'),array('size' => '40'));
}
// Phone
$form->addElement('text','phone',get_lang('PhoneNumber'));
@ -265,6 +271,10 @@ if( $form->validate())
$auth_source = $user['auth_source'];
}
UserManager::update_user($user_id,$firstname,$lastname,$username,$password,$auth_source,$email,$status,$official_code,$phone,$picture_uri,$expiration_date, $active);
if(api_get_setting('openid_authentication')=='true' && !empty($user['openid']))
{
$up = UserManager::update_openid($user_id,$user['openid']);
}
if($user_id != $_SESSION['_uid'])
{
if($platform_admin == 1)

@ -202,6 +202,20 @@ class UserManager
return true;
}
/**
* Update user information with new openid
* @param int $user_id
* @param string $openid
* @return boolean true if the user information was updated
*/
function update_openid($user_id, $openid)
{
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "UPDATE $table_user SET
openid='".Database::escape_string($openid)."'";
$sql .= " WHERE user_id='$user_id'";
return api_sql_query($sql,__FILE__,__LINE__);
}
/**
* Update user information
* @param int $user_id

Loading…
Cancel
Save