Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
ae1e69a5
Commit
ae1e69a5
authored
Aug 16, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ownCloud: code a way to add admins from our users table, but dont use it
parent
9e86c675
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
owncloud.sh
setup/owncloud.sh
+7
-0
mail.py
tools/mail.py
+8
-0
No files found.
setup/owncloud.sh
View file @
ae1e69a5
...
@@ -114,6 +114,13 @@ tools/editconf.py /etc/php5/fpm/php.ini -c ';' \
...
@@ -114,6 +114,13 @@ tools/editconf.py /etc/php5/fpm/php.ini -c ';' \
# TODO: somehow change the cron option in ownClouds config, not exposed afaik?
# TODO: somehow change the cron option in ownClouds config, not exposed afaik?
(
crontab
-u
www-data
-l
;
echo
"*/15 * * * * php -f /usr/local/lib/owncloud/cron.php"
)
| crontab
-u
www-data -
(
crontab
-u
www-data
-l
;
echo
"*/15 * * * * php -f /usr/local/lib/owncloud/cron.php"
)
| crontab
-u
www-data -
## Ensure all system admins are ownCloud admins.
## Actually we don't do this. There's nothing much of interest that the user could
## change from the ownCloud admin, and there's a lot they could mess up.
#for user in $(tools/mail.py user admins); do
# sqlite3 $STORAGE_ROOT/owncloud/owncloud.db "INSERT OR IGNORE INTO oc_group_user VALUES ('admin', '$user')"
#done
# Finished.
# Finished.
php5enmod imap
php5enmod imap
restart_service php5-fpm
restart_service php5-fpm
tools/mail.py
View file @
ae1e69a5
...
@@ -51,6 +51,7 @@ if len(sys.argv) < 2:
...
@@ -51,6 +51,7 @@ if len(sys.argv) < 2:
print
(
" tools/mail.py user remove user@domain.com"
)
print
(
" tools/mail.py user remove user@domain.com"
)
print
(
" tools/mail.py user make-admin user@domain.com"
)
print
(
" tools/mail.py user make-admin user@domain.com"
)
print
(
" tools/mail.py user remove-admin user@domain.com"
)
print
(
" tools/mail.py user remove-admin user@domain.com"
)
print
(
" tools/mail.py user admins (lists admins)"
)
print
(
" tools/mail.py alias (lists aliases)"
)
print
(
" tools/mail.py alias (lists aliases)"
)
print
(
" tools/mail.py alias add incoming.name@domain.com sent.to@other.domain.com"
)
print
(
" tools/mail.py alias add incoming.name@domain.com sent.to@other.domain.com"
)
print
(
" tools/mail.py alias remove incoming.name@domain.com"
)
print
(
" tools/mail.py alias remove incoming.name@domain.com"
)
...
@@ -92,6 +93,13 @@ elif sys.argv[1] == "user" and sys.argv[2] in ("make-admin", "remove-admin") and
...
@@ -92,6 +93,13 @@ elif sys.argv[1] == "user" and sys.argv[2] in ("make-admin", "remove-admin") and
action
=
"remove"
action
=
"remove"
print
(
mgmt
(
"/mail/users/privileges/"
+
action
,
{
"email"
:
sys
.
argv
[
3
],
"privilege"
:
"admin"
}))
print
(
mgmt
(
"/mail/users/privileges/"
+
action
,
{
"email"
:
sys
.
argv
[
3
],
"privilege"
:
"admin"
}))
elif
sys
.
argv
[
1
]
==
"user"
and
sys
.
argv
[
2
]
==
"admins"
:
# Dump a list of admin users.
users
=
mgmt
(
"/mail/users?format=json"
,
is_json
=
True
)
for
user
in
users
:
if
"admin"
in
user
[
'privileges'
]:
print
(
user
[
'email'
])
elif
sys
.
argv
[
1
]
==
"alias"
and
len
(
sys
.
argv
)
==
2
:
elif
sys
.
argv
[
1
]
==
"alias"
and
len
(
sys
.
argv
)
==
2
:
print
(
mgmt
(
"/mail/aliases"
))
print
(
mgmt
(
"/mail/aliases"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment