wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.UserXML.php
Go to the documentation of this file.
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2014 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of any of the following licenses
7  * at your choice:
8  *
9  * - GNU Lesser General Public License (LGPL)
10  * http://www.gnu.org/licenses/lgpl.html
11  * - Eclipse Public License (EPL)
12  * http://www.eclipse.org/org/documents/epl-v10.php
13  *
14  * See the license.txt file distributed with this work for
15  * additional information.
16  *
17  * $Id: class.UserXML.php 1462 2014-02-04 23:52:27Z iherwig $
18  */
19 require_once(BASE."wcmf/lib/security/class.UserImpl.php");
20 
21 /**
22  * @class User
23  * @ingroup Security
24  * @brief Implementation of a XML system user.
25  *
26  * @author ingo herwig <ingo@wemove.com>
27  */
28 class UserXML extends UserImpl
29 {
30  /**
31  * Default constructor.
32  */
33  function UserXML($oid=null, $type='UserXML')
34  {
35  parent::UserImpl($oid, $type);
36  }
37 
38  /**
39  * @see User::getUserOID()
40  */
41  function &getUser($login, $password)
42  {
43  $objectFactory = &ObjectFactory::getInstance();
44  $userManager = &$objectFactory->createInstanceFromConfig('implementation', 'UserManager');
45  $user = $userManager->getUser($login);
46  if ($user != null && $user->getPassword() == $password)
47  return $user;
48  return null;
49  }
50 
51  /**
52  * @see User::getRoleByName()
53  */
54  function &getRoleByName($rolename)
55  {
56  // load the role
57  $objectFactory = &ObjectFactory::getInstance();
58  $userManager = &$objectFactory->createInstanceFromConfig('implementation', 'UserManager');
59  $role = $userManager->getRole($rolename);
60  if ($role != null)
61  return $role;
62  else
63  return null;
64  }
65 }
66 ?>
UserXML($oid=null, $type='UserXML')
& getRoleByName($rolename)
& getUser($login, $password)