Merging latest changes from stable branch up to 2.3.24
[fa-stable.git] / admin / security_roles.php
index 9ffe8d7bc17f09cb3158f4c2a8217bdfff9189e4..885acd774429cc856b8584d1675d109ceee552c2 100644 (file)
@@ -85,14 +85,14 @@ if (get_post('addupdate'))
                $sections = array();
                $areas = array();
                foreach($_POST as $p =>$val) {
-                       if (substr($p,0,4) == 'Area') {
+                       if (substr($p,0,4) == 'Area' && $val == 1) {
                                $a = substr($p, 4);
                                if (($a&~0xffff) && (($a&0xff00)<(99<<8))) {
                                        $sections[] = $a&~0xff; // add extended section for plugins
                                }
                                $areas[] = (int)$a;
                        }
-                       if (substr($p,0,7) == 'Section')
+                       if (substr($p,0,7) == 'Section' && $val == 1)
                                $sections[] = (int)substr($p, 7);
                }
 //             $areas = sort_areas($areas);