Ver 1.53:
* html fixes in show_groups.php3
+* When reporting sql errors also print the output of da_sql_error
Ver 1.52:
* Add Reply-Message in conf/user_edit.attrs so that it appears in the user/group edit pages
* Allow the administrator to specify a group in the New User page. Update lib/sql/create_user.php3 to add
echo "<b>Could not find any groups</b><br>\n";
}
else
- echo "<b>Search failed. SQL Error</b><br>\n";
+ echo "<b>Search failed. SQL Error: " . da_sql_error($link,$config) . "</b><br>\n";
}
+else
+ echo "<b>Could not connect to SQL database</b><br>\n";
?>
</table>
</table>
echo "<b>SQL Error:" . da_sql_error($link) . "</b><br>\n";
}
else
- echo "<b>SQL Error: Could not connect to sql server(" . da_sql_error($link) . ")</b><br>\n";
+ echo "<b>SQL Error: Could not connect to SQL database</b><br>\n";
}
?>
(UserName,Name,Mail,Department,HomePhone,WorkPhone,Mobile) VALUES
('$login','$Fcn','$Fmail','$Fou','$Ftelephonenumber','$Fhomephone','$Fmobile');");
if (!$res || !@da_sql_affected_rows($link,$res,$config)){
- echo "<b>Could not add user information in user info table</b><br>\n";
+ echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
$fail = 1;
}
}
Department = '$Fou', HomePhone = '$Fhomephone', WorkPhone = '$Ftelephonenumber',
Mobile = '$Fmobile';");
if (!$res || !@da_sql_affected_rows($link,$res,$config)){
- echo "<b>Could not update user information in user info table</b><br>\n";
+ echo "<b>Could not update user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
$fail = 1;
}
}
}
else{
- echo "<b>Could not find user in user info table. SQL Error</b><br>\n";
+ echo "<b>Could not find user in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
$fail = 1;
}
if ($fail == 0)
"UPDATE $config[sql_check_table] SET Value = '$passwd' $text3 WHERE
Attribute = '$config[sql_password_attribute]' AND UserName = '$login';");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
- echo "<b>Error while changing password</b><br>\n";
+ echo "<b>Error while changing password: " . da_sql_error($link,$config) . "</b><br>\n";
}
else{
$res = @da_sql_query($link,$config,
"INSERT INTO $config[sql_check_table] (Attribute,Value,UserName $text1)
VALUES ('$config[sql_password_attribute]','$passwd','$login' $text2);");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
- echo "<b>Error while changing password</b><br>\n";
+ echo "<b>Error while changing password: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
else
- echo "<b>Error while executing query</b><br>\n";
+ echo "<b>Error while executing query: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not open encryption library file</b><br>\n";
"INSERT INTO $config[sql_usergroup_table] (UserName,GroupName)
VALUES ('$member','$login');");
if (!$res || !@da_sql_affected_rows($link,$res,$config)){
- echo "<b>Unable to add user $member in group $login. SQL error</b><br>\n";
+ echo "<b>Unable to add user $member in group $login: " . da_sql_error($link,$config) . "</b><br>\n";
$da_abort=1;
}
}
"INSERT INTO $table (Attribute,Value,GroupName $text)
VALUES ('$attrmap[$key]','$val','$login' $op_val);");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
- echo "<b>Query failed for attribute $key</b><br>\n";
+ echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
echo "<b>Group created successfully</b><br>\n";
"INSERT INTO $config[sql_check_table] (Attribute,Value,UserName $text)
VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);");
if (!$res || !@da_sql_affected_rows($link,$res,$config)){
- echo "<b>Unable to add user $login. SQL error</b><br>\n";
+ echo "<b>Unable to add user $login: " . da_sql_error($link,$config) . "</b><br>\n";
$da_abort=1;
}
if ($config[sql_use_user_info_table] == 'true' && !$da_abort){
(UserName,Name,Mail,Department,HomePhone,WorkPhone,Mobile) VALUES
('$login','$Fcn','$Fmail','$Fou','$Fhomephone','$Ftelephonenumber','$Fmobile');");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
- echo "<b>Could not add user information in user info table</b><br>\n";
+ echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>User already exists in user info table.</b><br>\n";
}
else
- echo "<b>Could not add user information in user info table</b><br>\n";
+ echo "<b>Could not add user information in user info table: " . da_sql_error($link,config) . "</b><br>\n";
}
if ($Fgroup != ''){
$res = @da_sql_query($link,$config,
echo "<b>User already is a member of group $Fgroup</b><br>\n";
}
else
- echo "<b>Could not add user to group $Fgroup. SQL Error</b><br>\n";
+ echo "<b>Could not add user to group $Fgroup: " . da_sql_error($link,$config) . "</b><br>\n";
}
if (!$da_abort){
foreach($show_attrs as $key => $attr){
"INSERT INTO $table (Attribute,Value,UserName $text)
VALUES ('$attrmap[$key]','$val','$login' $op_val);");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
- echo "<b>Query failed for attribute $key</b><br>\n";
+ echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
echo "<b>User created successfully</b><br>\n";
if ($res)
echo "<b>Group $login deleted successfully</b><br>\n";
else
- echo "<b>Error deleting group $login from usergroup table</b><br>\n";
+ echo "<b>Error deleting group $login from usergroup table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
- echo "<b>Error deleting group $login from group check table</b><br>\n";
+ echo "<b>Error deleting group $login from group check table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
- echo "<b>Error deleting group $login from group reply table</b><br>\n";
+ echo "<b>Error deleting group $login from group reply table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to database</b><br>\n";
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_usergroup_table] WHERE UserName = '$login';");
if (!$res)
- echo "<b>Error deleting user $login from user group table</b><br>\n";
+ echo "<b>Error deleting user $login from user group table: " . da_sql_error($link,$config) . "</b><br>\n";
if ($config[sql_use_user_info_table] == 'true'){
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_user_info_table] WHERE UserName = '$login';");
if ($res)
echo "<b>User $login deleted successfully</b><br>\n";
else
- echo "<b>Error deleting user $login from user info table</b><br>\n";
+ echo "<b>Error deleting user $login from user info table: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
else
- echo "<b>Error deleting user $login from check table</b><br>\n";
+ echo "<b>Error deleting user $login from check table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
- echo "<b>Error deleting user $login from reply table</b><br>\n";
+ echo "<b>Error deleting user $login from reply table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to database</b><br>\n";
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_usergroup_table] WHERE UserName = '$del' AND GroupName = '$login';");
if (!$res)
- echo "<b>Could not delete user $del from group. SQL Error</b><br>\n";
+ echo "<b>Could not delete user $del from group: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
if ($new_members != ''){
"INSERT INTO $config[sql_usergroup_table] (GroupName,UserName)
VALUES ('$login','$new_member');");
if (!$res)
- echo "<b>Error while adding user $new_member to group</b><br>\n";
+ echo "<b>Error while adding user $new_member to group: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
else
- echo "<b>Could not add new member $new_member. SQL Error</b><br>\n";
+ echo "<b>Could not add new member $new_member: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
}