static function give_permission(rACLActionHandler $self) { $ddm = DSM::Get(); if ($_POST) { $ddm->ACL_Set($_POST['record_id'], $_POST['resource_id']); redirect("owner", NULL, array($_POST['record_id'])); } else { } }
static function create_model(rAdminActionHandler $self) { $ddm = DSM::Get(); $_POST['modelname']; try { $ddm->CreateType($_POST['modelname']); } catch (WaxPDOException $wpdoe) { redirect("index"); } redirect("index", $_POST['modelname']); }
static function Authenticate(rLoginIdentifier $self, $password) { $ddm = DSM::Get(); // get the data source $objstruct = $ddm->ExamineType(get_class($self), true); $objstruct['Password']['value'] = $password; $pw = new PasswordAttribute($objstruct['Password']); $user = $ddm->Find(get_class($self), array("Username" => $self->GetUsername(), "Password" => $pw->Hash())); if ($user) { return $user; } else { throw new InvalidCredentialsException($self->GetUsername()); } }
static function editor(rPointerAttrActionHandler $self) { $ddm = DSM::Get(); $types = $ddm->ListTypes(); $view = array(); $view['types'] = $types; $options = $self->GetOptions(); $descs = array(); if (!isset($options['type'])) { foreach ($types as $tid => $type) { $descs[$type] = $ddm->ExamineType($type); } $vals = array_values($types); } else { $descs = array($options['type'] => $ddm->ExamineType($options['type'])); } $view['typeattrs'] = $descs; return $view; }
static function delete(rScaffolder $self) { $ddm = DSM::Get(); $did = $self->id; $ddm->Delete($self->GetType(), $did); redirect("index"); }
static function GetPermissions(rPermissionHolder $self) { // look up all ACL entries for this id $ddm = DSM::Get(); return $ddm->ACL_Get($self->id); }
static function modify_remove(rDynamicModelHandler $self, $attr2remove) { $ddm = DSM::Get(); $ddm->AlterType($self->GetType(), NULL, array($attr2remove)); redirect("modify"); }