image_link("Home", "", "images/home.gif");
/* Root gets full functionality */
- if ( is_root() == True) {
+ if (am_root() == True) {
image_link("Globals", "globals", "images/globals.gif");
image_link("Shares", "shares", "images/shares.gif");
image_link("Printers", "printers", "images/printers.gif");
/*
* smbpasswd requires a regular old user to send their old password
*/
- if ( is_root() == False) {
+ if (am_root() == False) {
n = (strlen(old) <= (MAX_STRINGLEN)) ? strlen(old) : (MAX_STRINGLEN);
strncpy( line, old, n);
line[n] = '\n'; n++; /* add carriage return */
/* Root can do more */
- if (is_root() == True) {
+ if (am_root() == True) {
if (cgi_variable(add_user_flag)) {
/*
* Add a user
****************************************************************************/
static void chg_passwd(void)
{
- char *s;
struct passwd *pass = NULL;
BOOL rslt;
if (!cgi_variable(disable_user_flag)) {
/* If current user is not root, make sure old password has been specified */
- if ((is_root() == False) && (strlen( cgi_variable(old_pswd)) <= 0)) {
+ if ((am_root() == False) && (strlen( cgi_variable(old_pswd)) <= 0)) {
printf("<p> Must specify \"Old Password\" \n");
return;
}
}
/* Get the UID/GID of the user, and become that user */
- if (is_root() == False) {
+ if (am_root() == False) {
pass = Get_Pwnam(cgi_variable(user),True);
if (pass == NULL) {
printf("<p> User uid unknown \n");
rslt = talk_to_smbpasswd( cgi_variable(old_pswd), cgi_variable(new_pswd));
- if (is_root() == False) {
+ if (am_root() == False) {
if (rslt == True) {
printf("<p> The passwd for '%s' has been changed. \n",cgi_variable(user));
} else {
static void passwd_page(void)
{
char *new_name;
- int i;
printf("<H2>Password Manager</H2>\n");
}
printf("<p> User Name : <input type=text size=30 name=%s value=%s> \n", user, new_name);
- if (is_root() == False) {
+ if (am_root() == False) {
printf("<p> Old Password: <input type=password size=30 name=%s>\n",old_pswd);
}
printf("<p> New Password: <input type=password size=30 name=%s>\n",new_pswd);
printf("</select></td></tr><p>");
printf("<tr><td>");
printf("<input type=submit name=%s value=\"Change Password\">", chg_passwd_flag);
- if (is_root() == True) {
+ if (am_root() == True) {
printf("<input type=submit name=%s value=\"Add New User\">", add_user_flag);
printf("<input type=submit name=%s value=\"Disable User\">", disable_user_flag);
}
page = cgi_pathinfo();
/* Root gets full functionality */
- if ( is_root() == True) {
+ if (am_root() == True) {
if (strcmp(page, "globals")==0) {
globals_page();
} else if (strcmp(page,"shares")==0) {