1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/limesurvey_ynh.git synced 2024-09-03 19:36:32 +02:00
limesurvey_ynh/hooks/post_user_create
zamentur c927cce4e7 [enh] set -e and trap
[enh] IGNORE when insert user in DB
[enh] Add upgrade scripts
[enh] Move upload dir in /home
2015-06-01 00:00:38 +02:00

5 lines
373 B
Bash

#!/bin/bash
db_pwd=$(sudo cat /etc/yunohost/mysql)
user=$1
mysql -u root -p$db_pwd limesurvey -e "INSERT IGNORE INTO prefix_users (users_name) VALUES ('$user');INSERT IGNORE INTO prefix_permissions (entity,entity_id,uid,permission,create_p,read_p,update_p,delete_p,import_p,export_p) SELECT 'global',0,uid,'surveys',1,1,1,1,0,1 FROM prefix_users WHERE users_name='$user'"