From: hickert Date: Thu, 16 Sep 2010 12:43:44 +0000 (+0000) Subject: Updated the Device class X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7fe222513ae89a9bca864f5b1374e5f22aae7d0f;p=gosa.git Updated the Device class git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19712 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc index 3c8634267..f027ab152 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc @@ -33,6 +33,10 @@ class Device extends plugin private $resolvedNamesCache = array(); + + /*! \brief Constructs the device object and keep some + * initial values. + */ function __construct(&$config, $dn) { plugin::plugin($config, $dn); @@ -41,15 +45,21 @@ class Device extends plugin } + /*! \brief Generate a fake uuid, it is not a real uuid. + * @return String A fake uuid. + */ function genFakeUuid() { - $strfmt = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + $strfmt = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; for($i=0;$icurrentUserSelect = "owner"; $this->dialog = new singleUserSelect($this->config, get_userinfo()); } + + // Change manager requested, initiate a user selection dialog. if(isset($_POST['editManager'])){ $this->currentUserSelect = "manager"; $this->dialog = new singleUserSelect($this->config, get_userinfo()); } + + // The user selection dialog has send that it has finished its job. + // Store the posted user-dn as manager or owner. if($this->dialog && $this->dialog instanceOf singleUserSelect && count($this->dialog->detectPostActions())){ $users = $this->dialog->detectPostActions(); if(isset($users['action']) && $users['action'] == 'userSelected' && isset($users['targets']) && count($users['targets'])){ @@ -125,14 +144,19 @@ class Device extends plugin $this->dialog = NULL; } } + + // User selection canceled if(isset($_POST['add_users_cancel'])){ $this->dialog = NULL; } - + + // Regenerate a new uuid if(isset($_POST['reloadUUID'])) $this->deviceUUID = $this->genFakeUuid(); } + /*! \brief Save the modified object back to the ldap. + */ function save() { plugin::save();