diff --git a/config.inc.php b/config.inc.php index d97731a32..28fd76280 100644 --- a/config.inc.php +++ b/config.inc.php @@ -9,22 +9,30 @@ function __construct(){ //Get parameter value pairs from fac_Config $sql='select Parameter, Value, DefaultVal from fac_Config'; - $sth=$dbh->prepare($sql); - $sth->execute(); - while ($row = $sth->fetch()) { - if ($row['Parameter']== 'ClassList'){ - $List = explode(', ', $row['Value']); - $this->ParameterArray[$row['Parameter']]=$List; - $this->defaults[$row['Parameter']]=$row['DefaultVal']; - }else{ - // this allows us to support quotes in paths for whatever reason - if(preg_match('/.*path$|PDFLogoFile/',$row['Parameter'])){ - $this->ParameterArray[$row['Parameter']]=html_entity_decode($row['Value'],ENT_QUOTES); + $sth=$dbh->prepare($sql); + // this gets called via db.inc on a new install and will throw an exception + // this prevents that and allows the install to continue and call this again + // later and populate correctly + try { + $sth->execute(); + while ($row = $sth->fetch()) { + if ($row['Parameter']== 'ClassList'){ + $List = explode(', ', $row['Value']); + $this->ParameterArray[$row['Parameter']]=$List; + $this->defaults[$row['Parameter']]=$row['DefaultVal']; }else{ - $this->ParameterArray[$row['Parameter']]=$row['Value']; + // this allows us to support quotes in paths for whatever reason + if(preg_match('/.*path$|PDFLogoFile/',$row['Parameter'])){ + $this->ParameterArray[$row['Parameter']]=html_entity_decode($row['Value'],ENT_QUOTES); + }else{ + $this->ParameterArray[$row['Parameter']]=$row['Value']; + } + $this->defaults[$row['Parameter']]=$row['DefaultVal']; } - $this->defaults[$row['Parameter']]=$row['DefaultVal']; } + } catch (PDOException $e) { + $info=$e->getMessage(); + error_log("UpdateConfig::PDO Error: {$info} SQL=$sql"); } return; } diff --git a/rightscheck.php b/rightscheck.php index 3ac7c5d74..7c53653f1 100644 --- a/rightscheck.php +++ b/rightscheck.php @@ -17,7 +17,7 @@ $grpid=exec('id -g'); // The directories we want writable for uploads -$wantedpaths=array('drawings', 'pictures'); +$wantedpaths=array('drawings', 'pictures','assets/drawings','assets/pictures'); print " @@ -107,7 +107,8 @@ function printrow($file,&$wantedpaths,$userid,$grpid){ } # Add in extra paths here that aren't part of the root loop. -printrow('vendor'.DIRECTORY_SEPARATOR.'mpdf'.DIRECTORY_SEPARATOR.'mpdf'.DIRECTORY_SEPARATOR.'ttfontdata',$wantedpaths,$userid,$grpid); +printrow('assets'.DIRECTORY_SEPARATOR.'drawings',$wantedpaths,$userid,$grpid); +printrow('assets'.DIRECTORY_SEPARATOR.'pictures',$wantedpaths,$userid,$grpid); # Handle paths that may or may not be set in the configuration screen for docker # clowns.