Changeset 406
- Timestamp:
- 10/05/12 12:44:13 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r404 r406 1419 1419 return if !$args{fullname}; 1420 1420 1421 my $tmpuser = $dbh->selectrow_hashref("SELECT user_id AS userid,group_id,firstname,lastname,status". 1421 $args{username} = "$args{username}/$args{rpcsys}"; 1422 1423 my $tmpuser = $dbh->selectrow_hashref("SELECT username,user_id AS userid,group_id,firstname,lastname,status". 1422 1424 " FROM users WHERE username=?", undef, ($args{username}) ); 1423 if (! %userdata) {1425 if (!$tmpuser) { 1424 1426 $dbh->do("INSERT INTO users (username,password,firstname,type) VALUES (?,'RPC',?,'R')", undef, 1425 1427 ($args{username}, $args{fullname}) ); 1426 $tmpuser = $dbh->selectrow_hashref("SELECT user _id AS userid,group_id,firstname,lastname,status".1428 $tmpuser = $dbh->selectrow_hashref("SELECT username,user_id AS userid,group_id,firstname,lastname,status". 1427 1429 " FROM users WHERE username=?", undef, ($args{username}) ); 1428 1430 } 1429 1431 %userdata = %{$tmpuser}; 1430 1432 $userdata{fullname} = "$userdata{firstname} $userdata{lastname} ($args{rpcsys})"; 1431 $userdata{username} = "$args{username}/$args{rpcsys}"; 1432 return 1 if %userdata; 1433 return 1 if $tmpuser; 1433 1434 } # end initRPC() 1434 1435 … … 2557 2558 my $dbh = shift; 2558 2559 my $group = shift; 2559 my ($grpid) = $dbh->selectrow_array("SELECT group_id FROM groups WHERE group =?", undef, ($group) );2560 my ($grpid) = $dbh->selectrow_array("SELECT group_id FROM groups WHERE group_name=?", undef, ($group) ); 2560 2561 $errstr = $DBI::errstr if !$grpid; 2561 2562 return $grpid if $grpid;
Note:
See TracChangeset
for help on using the changeset viewer.