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

6 lines
359 B
Text
Raw Normal View History

#!/bin/bash
db_pwd=$(sudo cat /etc/yunohost/mysql)
user=$1
mysql -u root -p$db_pwd limesurvey -e "INSERT INTO prefix_users (users_name) VALUES ('$user');INSERT 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'"