+ if ($this->old_db) {
+ // Transition code:
+ // db was not yet upgraded after source update to v.2.2
+ // give enough access for admin user to continue upgrade
+ if (!isset($security_groups) || !isset($security_headings)) {
+ echo "<center><br><br><font size='5' color='red'><b>";
+ echo _('Before software upgrade you have to include old $security_groups and $security_headings arrays from old config.php file to the new one.');
+ echo '<br>'."<a href=$path_to_root/index.php>"._("Back")."</a>";
+ echo "</b></font><br><br></center>";
+ exit;
+ }
+ $this->access = $myrow["full_access"];
+ if (in_array(20, $security_groups[$this->access]))
+ // temporary access for admin users
+ $this->role_set[] = $security_areas['SA_SOFTWAREUPGRADE'][0];
+ else {
+ echo "<center><br><br><font size='5' color='red'><b>";
+ echo _('System is available for site admin only until full database upgrade');
+ echo "</b></font><br><br></center>";
+ exit;
+ }
+ } else {
+ $this->role_set = array();
+ $this->access = $myrow["role_id"];
+ // store area codes available for current user role
+ $role = get_security_role($this->access);
+ if (!$role)
+ return false;
+ foreach( $role['areas'] as $code )
+ // filter only area codes for enabled security sections
+ if (in_array($code&~0xff, $role['sections']))
+ $this->role_set[] = $code;
+ }