aboutsummaryrefslogtreecommitdiff
path: root/passwd_db.tcl
blob: 5c80c5bd4281a8f81d124aab211d883db0bee38e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# (C) 2011 by Eugeniy Mikhailov, <evgmik@gmail.com>
# vim:set ft=tcl: \
exec tclsh "$0" "$@"

# set new password for user name
#   create user 

package require sqlite3
package require md5
package require json::write
source ./GradeBook_lib.tcl

if { $argc < 3 } {
	puts {Usage:}
	puts "$argv0 password_database_file user_name password"
	exit
}

set db_file [lindex $argv 0] 
set user_name [lindex $argv 1] 

if { $argc >= 3 } {
	set password [lindex $argv 2] 
} else {
	set password {}
}

# override default password DB name
set GradebookServerConfig(passwords_db_file) $db_file

Set_New_Password_Non_Web $user_name $password



# vim: ts=2 sw=2 foldmethod=indent: