From b7c82845dae7f4347fb18d594920f73126c9083b Mon Sep 17 00:00:00 2001 From: Michael Wesemann Date: Thu, 16 May 2024 11:27:57 +0200 Subject: [PATCH] - --- archive.rewrite.conf | 5 + src/access.php | 5 +- src/admin.php | 8 +- src/edit.php | 8 +- src/index.php | 70 +++++++++++-- src/init.php | 16 +-- src/login.php | 2 - src/preview.php | 2 +- src/rest.php | 240 +++++++++++++++++++++++++++++++++++++++++-- src/search.php | 32 ++++-- src/tools.php | 16 +++ src/version.php | 2 +- 12 files changed, 364 insertions(+), 42 deletions(-) diff --git a/archive.rewrite.conf b/archive.rewrite.conf index 3f863ad..31cf55f 100644 --- a/archive.rewrite.conf +++ b/archive.rewrite.conf @@ -8,6 +8,9 @@ RewriteRule ^/activate/(.*)$ /activate.php?key=$1 RewriteRule ^/search/(\d+)$ /search.php?pid=$1 RewriteRule ^/search$ /search.php + +RewriteRule ^/([A-Z,a-z]\d+)/print$ /index.php?mode=print&id=$1 + RewriteRule ^/([A-Z,a-z]\d+)/edit/do/(\d+)$ /edit.php?mode=edit&id=$1&docoff=$2 RewriteRule ^/([A-Z,a-z]\d+)/edit$ /edit.php?mode=edit&id=$1 RewriteRule ^/([A-Z,a-z]\d+)/clone$ /edit.php?mode=clone&id=$1 @@ -49,5 +52,7 @@ RewriteRule ^/clrcopy /edit.php?mode=clrcopy RewriteRule ^/uploadcopy /uploadcopy.php RewriteRule ^/maintenance /maintenance.php +RewriteRule ^/settings /settings.php + RewriteRule ^/scan/([^/]*) /scan.php?catid=$1 RewriteRule ^/v1/(.*) /rest.php?cmd=$1 diff --git a/src/access.php b/src/access.php index dcf84b6..5c3357d 100644 --- a/src/access.php +++ b/src/access.php @@ -1,6 +1,6 @@ $pname) $pl.="$pid,"; // build ACCESSQL $pl=PR("/(^.*),\s*$/","($1)",$pl); $ACCESSQL="(cat.user='$USER' OR access='public' OR (access='project' AND project IN $pl)) AND cat.rm=0"; + $LACCESSQL="(luser='$USER' OR laccess='public' OR (laccess='project' AND lproject IN $pl))"; } elseif ($ROLE==3) { // -------------------------------------------------------------------- limited user @@ -66,6 +68,7 @@ $pl=PR("/(^.*),\s*$/","($1)",$pl); $ACCESSQL="(cat.user='$USER' OR cat.access='public' OR (cat.access='project' AND cat.project IN $pl)) ". "AND cat.rm=0"; + $LACCESSQL="(luser='$USER' OR laccess='public' OR (laccess='project' AND lproject IN $pl))"; } return 1; diff --git a/src/admin.php b/src/admin.php index f4dc5d6..8ff6c5b 100644 --- a/src/admin.php +++ b/src/admin.php @@ -93,7 +93,6 @@ - @@ -102,8 +101,13 @@ onclick="return confirm('Invite user \'\' again?')" CLASS='icon'> - + + + + + diff --git a/src/edit.php b/src/edit.php index c8fcd52..e01423c 100644 --- a/src/edit.php +++ b/src/edit.php @@ -258,7 +258,7 @@ } if (PM("/^\d+$/",$catid) && $mode==='copy') { // copy id to list - if (chkeditaccess($catid)) { + if (chkreadaccess($catid)) { $_SESSION['copylist'][$catid]=$catid; header("Location: /home");exit; } @@ -343,7 +343,7 @@ $eoa=$row['oa']; for ($i=0;$i<$FMAX;$i++) $ef[$i]=$efl[$i]=$row["f$i"]; - + $J=json_decode($row['jsonmeta'],true); $sctype=$J['type']; @@ -362,7 +362,7 @@ if (PM("/^\s*$/",$otype)) $ctype=$otype; - if (PM("/^\s*$/",$ctype)) $ctype='data'; // ToDo: change to feault type + if (PM("/^\s*$/",$ctype)) $ctype=$DEVTYPE; if (!preg_match("/^\s*$/",$ctype)) { for ($i=0;$i<$FMAX;$i++) { @@ -431,7 +431,7 @@ + style='width:600px;white-space: pre-wrap;'> diff --git a/src/index.php b/src/index.php index 80fc00d..f5d66d5 100644 --- a/src/index.php +++ b/src/index.php @@ -1,5 +1,6 @@ + + 'ssh-rsa')); + + ssh2_auth_pubkey_file($connection, 'root','/db/ssh/id_rsa.pub','/db/ssh/id_rsa'); + + ssh2_scp_send($connection, "/db/tmp/$id.png", "/tmp/$id.png", 0644); + ssh2_exec($connection, "/usr/bin/lp -o fit-to-page -d archivzebra /tmp/$id.png"); + ssh2_exec($connection, "/bin/rm /tmp/$id.png"); + + header("Location: /$id");exit; + } + + ?> +

Metadata

@@ -79,6 +98,12 @@ + + + + + + @@ -97,13 +122,22 @@ + + + + + + +     + fixed entry - Id / + Id + / Ancestry: @@ -190,6 +224,19 @@ $tmp=AL($row["f$n"]); } ?> + + ", $tmp); + + $Parsedown = new Parsedown(); + + $tmp= $Parsedown->text($tmp); + + } + ?> + @@ -252,8 +299,9 @@ - + - - + + + + + + + + + + @@ -384,7 +440,8 @@