ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilRadiusAttributeToUser Class Reference
+ Collaboration diagram for ilRadiusAttributeToUser:

Public Member Functions

 __construct ()
 Constructor.
 create ($a_username)
 Create new ILIAS account.

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 32 of file class.ilRadiusAttributeToUser.php.

Constructor & Destructor Documentation

ilRadiusAttributeToUser::__construct ( )

Constructor.

public

Definition at line 40 of file class.ilRadiusAttributeToUser.php.

References $ilLog, and ilRadiusSettings\_getInstance().

{
global $ilLog;
$this->log = $ilLog;
include_once('Services/Radius/classes/class.ilRadiusSettings.php');
$this->rad_settings = ilRadiusSettings::_getInstance();
include_once('./Services/Xml/classes/class.ilXmlWriter.php');
$this->writer = new ilXmlWriter();
}

+ Here is the call graph for this function:

Member Function Documentation

ilRadiusAttributeToUser::create (   $a_username)

Create new ILIAS account.

public

Parameters
stringexternal username

Definition at line 60 of file class.ilRadiusAttributeToUser.php.

References ilAuthUtils\_generateLogin().

{
$this->writer->xmlStartTag('Users');
// Single users
// Required fields
// Create user
$this->writer->xmlStartTag('User',array('Action' => 'Insert'));
$this->writer->xmlElement('Login',array(),$new_name = ilAuthUtils::_generateLogin($a_username));
// Assign to role only for new users
$this->writer->xmlElement('Role',array('Id' => $this->rad_settings->getDefaultRole(),
'Type' => 'Global',
'Action' => 'Assign'),'');
$this->writer->xmlElement('Active',array(),"true");
$this->writer->xmlElement('TimeLimitOwner',array(),7);
$this->writer->xmlElement('TimeLimitUnlimited',array(),1);
$this->writer->xmlElement('TimeLimitFrom',array(),time());
$this->writer->xmlElement('TimeLimitUntil',array(),time());
$this->writer->xmlElement('AuthMode',array('type' => 'radius'),'radius');
$this->writer->xmlElement('ExternalAccount',array(),$a_username);
$this->writer->xmlEndTag('User');
$this->writer->xmlEndTag('Users');
$this->log->write('Radius: Started creation of user: '.$new_name);
include_once './Services/User/classes/class.ilUserImportParser.php';
$importParser = new ilUserImportParser();
$importParser->setXMLContent($this->writer->xmlDumpMem(false));
$importParser->setRoleAssignment(array($this->rad_settings->getDefaultRole() => $this->rad_settings->getDefaultRole()));
$importParser->setFolderId(7);
$importParser->startParsing();
return $new_name;
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: