--- cgiauth.c.orig	Mon Mar 31 19:09:33 2008
+++ cgiauth.c	Sat Apr  5 05:47:15 2008
@@ -56,6 +56,7 @@
 	authinfo->authorized_for_system_information=FALSE;
 	authinfo->authorized_for_system_commands=FALSE;
 	authinfo->authorized_for_configuration_information=FALSE;
+	authinfo->authorized_for_read_only=FALSE;
 
 	/* grab username from the environment... */
 	temp_ptr=getenv("REMOTE_USER");
@@ -153,6 +154,13 @@
 						authinfo->authorized_for_system_commands=TRUE;
 				        }
 			        }
+			else if(strstr(input,"authorized_for_read_only=")==input){
+                                temp_ptr=strtok(input,"=");
+                                while((temp_ptr=strtok(NULL,","))){
+                                        if(!strcmp(temp_ptr,authinfo->username) || !strcmp(temp_ptr,"*"))
+                                                authinfo->authorized_for_read_only=TRUE;
+                                        }
+                                }
 		        }
 
 		/* free memory and close the file */
@@ -241,6 +249,19 @@
 	return TRUE;
         }
 
+/* check if current user is restricted to read only */
+int is_authorized_for_read_only(authdata *authinfo){
+
+        /* if we're not using authentication, fake it */
+        if(use_authentication==FALSE)
+                return FALSE;
+
+        /* if this user has not authenticated return error */
+        if(authinfo->authenticated==FALSE)
+                return FALSE;
+
+        return authinfo->authorized_for_read_only;
+        }
 
 /* check if user is authorized to view information about a particular service */
 int is_authorized_for_service(service *svc, authdata *authinfo){
