예제 #1
0
 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 {
     }
 }
예제 #2
0
 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']);
 }
예제 #3
0
 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());
     }
 }
예제 #4
0
 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;
 }
예제 #5
0
 static function delete(rScaffolder $self)
 {
     $ddm = DSM::Get();
     $did = $self->id;
     $ddm->Delete($self->GetType(), $did);
     redirect("index");
 }
예제 #6
0
 static function GetPermissions(rPermissionHolder $self)
 {
     // look up all ACL entries for this id
     $ddm = DSM::Get();
     return $ddm->ACL_Get($self->id);
 }
예제 #7
0
 static function modify_remove(rDynamicModelHandler $self, $attr2remove)
 {
     $ddm = DSM::Get();
     $ddm->AlterType($self->GetType(), NULL, array($attr2remove));
     redirect("modify");
 }