View Issue Details

IDProjectCategoryView StatusLast Update
0015433phpList 3 applicationInterface - Backendpublic05-10-15 12:53
Reporteradrian15 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionwon't fix 
Product VersionFuture developments 
Target VersionFuture developmentsFixed in Version 
Summary0015433: Simple configure patch
DescriptionThis patch lets you define in config.php the options that the configure page should show the normal admin to edit.

In some hosted solutions you might not like that values like domain or webpage might be changed (because it screws installation) so you can avoid their change.

Actually the patch does not avoid actual change, I mean, the admin, can manage to type the correspondent url to change the fields that are not found in the simple configure. If you need more security (meaning smart admin screwing their own installation) you will need to hack it yourself.

adrian15
TagsNo tags attached.

Activities

12-04-10 18:41

 

C08_simple_configure.patch (2,038 bytes)
diff -urN linkaadmin_simple_configure_before/lists/admin/configure.php linkaadmin_simple_configure_after/lists/admin/configure.php
--- linkaadmin_simple_configure_before/lists/admin/configure.php	2010-04-10 07:10:28.000000000 +0200
+++ linkaadmin_simple_configure_after/lists/admin/configure.php	2010-04-10 08:42:21.000000000 +0200
@@ -39,6 +39,7 @@
 
 if (!$id) {
   while (list($key,$val) = each($default_config)) {
+    if ((isSuperUser()) || (!(ENABLE_CUSTOM_CONFIGURE))  || (in_array($key,$custom_configure_fields))   )  {
     if (is_array($val)) {
       $dbval = getConfig($key);
       if (isset($dbval))
@@ -48,6 +49,7 @@
       printf('<p><a href="%s">%s</a> <b>%s</b><br/>',PageURL2("configure","","id=$key"),$GLOBALS['I18N']->get('edit'),$GLOBALS['I18N']->get($val[1]));
       print nl2br(htmlspecialchars(stripslashes($value))) . "<br/><hr/>";
     }
+    }
   }
 } else {
   $val = $default_config[$id];
diff -urN linkaadmin_simple_configure_before/lists/config/config.php linkaadmin_simple_configure_after/lists/config/config.php
--- linkaadmin_simple_configure_before/lists/config/config.php	2010-04-10 07:10:48.000000000 +0200
+++ linkaadmin_simple_configure_after/lists/config/config.php	2010-04-10 08:42:35.000000000 +0200
@@ -686,6 +686,13 @@
 # very welcome!
 $database_module = "mysql.inc";
 
+# Custom configure fields for non superadmins admins
+#
+# 
+define("ENABLE_CUSTOM_CONFIGURE",0);
+$custom_configure_fields = array ("subscribesubject","subscribemessage","unsubscribesubject","unsubscribemessage", "confirmationsubject","confirmationmessage","updatesubject","updatemessage","emailchanged_text","emailchanged_text_oldaddress","personallocation_subject","personallocation_message","messagefooter","forwardfooter","pageheader","pagefooter","html_email_style");
+
+
 # you can store sessions in the database instead of the default place by assigning
 # a tablename to this value. The table will be created and will not use any prefixes
 # this only works when using mysql and only for administrator sessions

h2b2

14-04-10 13:25

manager   ~0050893

Since, in a way, this would be an extension of the admin permissions settings to include what is displayed on the configuration page: changing feature category from 'Interface - Frontend' to 'Interface - Backend'.

Instead of adding these settings to config.php, wouldn't the admin permissions page be a more logical place to configure this?

adrian15

14-04-10 13:36

reporter   ~0050895

You are right.

The reason why I used config.php file is to avoid having to modify the database to add these new permissions values to a new? table. Creating the table, setting setup scripts to create the table when you upgrade from an old phplist version and so on.

Too much work if you do not know if it is going to be accepted in upstream.

So you take my patch as a workaround if you want.

adrian15