send_sms: gepass.getuser() pour l'user courant
This commit is contained in:
parent
98aeef1811
commit
336b2eafb1
1 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ sys.path.append('/usr/scripts/gestion/secrets')
|
|||
from secrets import asterisk_sms_passwd
|
||||
sys.path.pop()
|
||||
import os
|
||||
import getpass
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
|
@ -35,7 +36,7 @@ from sip.asterisk import Manager
|
|||
if __name__ == '__main__':
|
||||
args = parser.parse_args(sys.argv[1:])
|
||||
|
||||
login = os.getenv("SUDO_USER") or os.getenv("USER")
|
||||
login = getpass.getuser()
|
||||
ldap = lc_ldap.shortcuts.lc_ldap_readonly()
|
||||
adh = ldap.search(u'uid=%s' % login)[0]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue