Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
90e2962c
Commit
90e2962c
authored
13 years ago
by
Jakob Sack
Browse files
Options
Downloads
Patches
Plain Diff
Remove the link between the principals table and the sabre principals connector.
parent
503e5cad
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/base.php
+0
-4
0 additions, 4 deletions
lib/base.php
lib/connector/sabre/principal.php
+0
-44
0 additions, 44 deletions
lib/connector/sabre/principal.php
with
0 additions
and
48 deletions
lib/base.php
+
0
−
4
View file @
90e2962c
...
...
@@ -316,10 +316,6 @@ class OC{
OC_App
::
loadApps
();
}
// Last part: connect some hooks
OC_HOOK
::
connect
(
'OC_User'
,
'post_createUser'
,
'OC_Connector_Sabre_Principal'
,
'addPrincipal'
);
OC_HOOK
::
connect
(
'OC_User'
,
'post_deleteUser'
,
'OC_Connector_Sabre_Principal'
,
'deletePrincipal'
);
//make sure temporary files are cleaned up
register_shutdown_function
(
array
(
'OC_Helper'
,
'cleanTmp'
));
}
...
...
This diff is collapsed.
Click to expand it.
lib/connector/sabre/principal.php
+
0
−
44
View file @
90e2962c
...
...
@@ -8,50 +8,6 @@
*/
class
OC_Connector_Sabre_Principal
implements
Sabre_DAVACL_IPrincipalBackend
{
/**
* TODO: write doc
*/
public
static
function
addPrincipal
(
$params
){
// Add the user
$uri
=
'principals/'
.
$params
[
'uid'
];
$displayname
=
$params
[
'uid'
];
$query
=
OC_DB
::
prepare
(
'INSERT INTO *PREFIX*principals (uri,displayname) VALUES(?,?)'
);
$query
->
execute
(
array
(
$uri
,
$displayname
));
// Add calendar and addressbook read and write support (sharing calendars)
$uri
=
'principals/'
.
$params
[
'uid'
]
.
'/calendar-proxy-read'
;
$displayname
=
null
;
$query
->
execute
(
array
(
$uri
,
$displayname
));
$uri
=
'principals/'
.
$params
[
'uid'
]
.
'/calendar-proxy-write'
;
$query
->
execute
(
array
(
$uri
,
$displayname
));
$uri
=
'principals/'
.
$params
[
'uid'
]
.
'/addressbook-proxy-read'
;
$query
->
execute
(
array
(
$uri
,
$displayname
));
$uri
=
'principals/'
.
$params
[
'uid'
]
.
'/addressbook-proxy-write'
;
$query
->
execute
(
array
(
$uri
,
$displayname
));
return
true
;
}
/**
* TODO: write doc
*/
public
static
function
deletePrincipal
(
$params
){
$query
=
OC_DB
::
prepare
(
'SELECT * FROM *PREFIX*principals'
);
$result
=
$query
->
execute
();
$deleteprincipal
=
OC_DB
::
prepare
(
'DELETE FROM *PREFIX*principals WHERE id = ?'
);
$deletegroup
=
OC_DB
::
prepare
(
'DELETE FROM *PREFIX*principalgroups WHERE principal_id = ? OR member_id = ?'
);
// We have to delete the principals and relations! Principals include
while
(
$row
=
$result
->
fetchRow
()){
// Checking if the principal is in the prefix
$array
=
explode
(
'/'
,
$row
[
'uri'
]);
if
(
$array
[
1
]
!=
$params
[
'uid'
])
continue
;
$deleteprincipal
->
execute
(
array
(
$row
[
'id'
]));
$deletegroup
->
execute
(
array
(
$row
[
'id'
],
$row
[
'id'
]));
}
return
true
;
}
/**
* Returns a list of principals based on a prefix.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment