Mediendatenbank / Verzeichnisse

Hier können Probleme und alles andere in Deutscher Sprache gelöst werden.
Post Reply
tomm
Regular
Posts: 8
Joined: Fri May 04, 2007 9:57 pm
Contact:

Mediendatenbank / Verzeichnisse

Post by tomm »

Hallo

Ich hab hier eine Installation auf Debian laufen (Serendipity 1.0.4-1 und PHP 5.2.0-8+etch1) und folgendes Problem:

Verwaltungsoberfläche -> Mediendatenbank -> Verzeichnisse verwalten -> Neues Verzeichnis Anlegen

Das funktioniert soweit. Ich seh aufm Dateisystem nach dem "Anlegen" das entsprechenden Verzeichnis:

Code: Select all

pwd: /usr/share/serendipity/www/uploads
drwxrwxrwx  2 www-data www-data  4096 May  4 21:42 2007-Mai/
Allerdings sehe ich ihn in der Verwaltungsoberfläche nirgends (zB Mediendaten hinzufügen)... Muss ich da noch was konfigurieren?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Mediendatenbank / Verzeichnisse

Post by garvinhicking »

Hi!

Wenn Du "Mediendaten hinzufügen" machst müsste es ein Dropdown geben für die Verzeichniswahl - erscheint es dort nicht?! Kannst Du davon mal einen screenshot machen?

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tomm
Regular
Posts: 8
Joined: Fri May 04, 2007 9:57 pm
Contact:

Post by tomm »

Nein, das eben erstelle Verzeichnis ist eben nirgends "sichtbar"...

Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Und wenn Du "Verzeichnisse verwalten" anklickst kommt ebenfalls nichts?

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tomm
Regular
Posts: 8
Joined: Fri May 04, 2007 9:57 pm
Contact:

Mediendatenbank / Verzeichnisse

Post by tomm »

garvinhicking wrote: Und wenn Du "Verzeichnisse verwalten" anklickst kommt ebenfalls nichts?
Hallo Garvin

Du hast richtig vermutet, auch dort wirds nicht angezeigt. Ich habe dort nur das "Stammverzeichnis", und darunter den Button Neues Verzeichnis anlegen.

Ich hab jez folgendes gemacht:


Neues Verzeichnis anlegen -> mit dem Namen eins... geht.
Dann nochmals: Verzeichnisse verwalten -> Neues Verzeichnis anlegen -> mit dem Namen eins... Meldung:

Code: Select all

Keine Schreibrechte für Verzeichnis eins. Bitte korrigieren
Das Verzeichnis "eins" ist auf der FS-Ebene sichtbar, nicht aber in der Verwaltungsoberfläche... :-(

Code: Select all

root@its# pwd
/usr/share/serendipity/www/uploads
root@its# ls -ld eins
drwxrwxrwx  2 www-data www-data 4096 May  7 12:29 eins/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Mediendatenbank / Verzeichnisse

Post by garvinhicking »

Hi!

Wie sieht deine "serendipity_access" tabelle aus, führ mal folgendes aus:

Code: Select all

SELECT * FROM serendipity_access WHERE artifact_type = 'directory'
Eventuell ist deine Pfadkonfiguration nicht ganz korrekt. Was hast Du eingetragen in der s9y konfiguration bei den "Verzeichnissen"? Besonders die Upload-Pfade wären interessant.

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tomm
Regular
Posts: 8
Joined: Fri May 04, 2007 9:57 pm
Contact:

Re: Mediendatenbank / Verzeichnisse

Post by tomm »

garvinhicking wrote:Wie sieht deine "serendipity_access" tabelle aus
Oh *schwitz* wo hab ich das Passwort? ... Melde mich nochmals, wenn ich das raushabe.
garvinhicking wrote:Eventuell ist deine Pfadkonfiguration nicht ganz korrekt. Was hast Du eingetragen in der s9y konfiguration bei den "Verzeichnissen"?
Damit kann ich dienen :-)

Voller Pfad /usr/share/serendipity/www/
Upload-Pfad uploads/
Relativer HTTP-Pfad /serendipity/
Relativer Template-Pfad templates/
Relativer Upload-Pfad uploads/
tomm
Regular
Posts: 8
Joined: Fri May 04, 2007 9:57 pm
Contact:

Post by tomm »

Das Passwort für mysql hab ich verloren, vergeigt, vergessen... Mit dem Hash aus der /etc/serendipity/ kann ich auch nix anfangen - oder?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Das Passwort zu MySQL steht in der serendipity_config_local.inc.php.

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tomm
Regular
Posts: 8
Joined: Fri May 04, 2007 9:57 pm
Contact:

Post by tomm »

Ok, unter Debian ist das Passwort in /etc/serendipity/database.inc.php, das mittels #include in der serendipity_config_local.inc.php reingeladen wird. Was ich für einen Hash gehalten habe, ist das (automagisch?) erzeugte Passwort. Soweit sogut...

Dein SELECT ergibt keine Hits. Die access table sieht so aus:

Code: Select all

mysql> select * from s9y_access;
+---------+-------------+---------------+---------------+----------------+
| groupid | artifact_id | artifact_type | artifact_mode | artifact_index |
+---------+-------------+---------------+---------------+----------------+
|       0 |           1 | category      | read          |                | 
|       0 |           1 | category      | write         |                | 
|       0 |           2 | category      | read          |                | 
|       0 |           2 | category      | write         |                | 
+---------+-------------+---------------+---------------+----------------+
4 rows in set (0.00 sec)
Hmmhmmhmm fehlt da was?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hhm. Vielleicht hängt dein problem mit dem debian-s9y zusammen. Mit dem hab ich nämlich keine Erfahrungen.

Die Verzeichnisse werden nämlich relativ vom aktuellen verzeichnis ausgelesen, vielleicht unterscheidet sich das bei debian von dem wirklichen verzeichnis wo HTTP drin liegt.

In der datei include/functions_images.inc.php gibt es folgende Funktion, ersetz die mal durch das was ich hierhin schreibe:

Code: Select all

function serendipity_traversePath($basedir, $dir='', $onlyDirs = true, $pattern = NULL, $depth = 1, $max_depth = NULL, $apply_ACL = false, $aExcludeDirs = NULL) {

    if ($aExcludeDirs === null) {
        $aExcludeDirs = array("CVS" => true, ".svn" => true);
    }

    $odir = serendipity_dirSlash('end', $basedir) . serendipity_dirSlash('end', $dir);
    echo "opening directory handle to $odir...<br />\n";  // GARVIN DEBUG
    $dh = @opendir($odir);
    if (!$dh) {
        return array();
    }

    $files = array();
    while (($file = @readdir($dh)) !== false) {
        echo "Got $file...<br />\n";  // GARVIN DEBUG
       
        if ($file != '.' && $file != '..') {
            $bPatternMatch = (is_null($pattern) || preg_match($pattern, $file));
			$sFullPath     = $odir . $file;
			$bIsDir        = is_dir($sFullPath);
            if ($onlyDirs === false || $bIsDir) {
                echo " - Matching onlyDirs / bIsDir.<br />\n"; // GARVIN DEBUG
				if ($bPatternMatch &&
				    (!$bIsDir || $aExcludeDirs == null || !isset($aExcludeDirs[$file]))) {
                    $files[] = array(
                        'name'      => $file,
                        'depth'     => $depth,
                        'relpath'   => ltrim(str_replace('\\', '/', serendipity_dirSlash('end', $dir)) . basename($file) . ($bIsDir ? '/' : ''), '/'),
                        'directory' => $bIsDir
                    );
                    echo " - Matched on Pattern.<br />\n"; // GARVIN DEBUG
                }
            }

            if ($bIsDir &&
				($max_depth === null || $depth < $max_depth) &&
				($aExcludeDirs == null || !isset($aExcludeDirs[$file]))) {
                $next_dir = serendipity_dirSlash('end', $dir) . basename($file);
                echo " - Matched on subdirectory, traversing....<br />\n"; // GARVIN DEBUG
				$files = array_merge($files, serendipity_traversePath($basedir, $next_dir, $onlyDirs, $pattern, ($depth+1), $max_depth, $apply_ACL, $aExcludeDirs));
            }
        }
    }

    @closedir($dh);

    if ($depth == 1 && $apply_ACL !== FALSE) {
        echo "Got listing, pushing through ACL: <pre>" . print_r($files, true) . "</pre>...<br />\n"; // GARVIN DEBUG
        serendipity_directoryACL($files, $apply_ACL);
    }

    echo "Returning Result: <pre>" . print_r($files, true) . "</pre>...<br />\n"; // GARVIN DEBUG
    return $files;
}
Meine Einfügungen sind mit "GARVIN DEBUG" gekennzeichnet. Wenn Du nun die Maske für "Verzeichnise Verwalten" öffnest müsstest Du eigentlich einige debugging-ausgaben sehen können. Die bitte mal mitteilen :)

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tomm
Regular
Posts: 8
Joined: Fri May 04, 2007 9:57 pm
Contact:

Post by tomm »

Hab mal bisschen DEBUG Code eingefügt. Da die Sourcen nicht übereinstimmen, hab ich nicht einfach deine Function eingebaut...

Hab mal folgendes gemacht:

Code: Select all

function serendipity_traversePath($basedir, $dir='', $onlyDirs=true, $pattern = NULL, $depth = 1, $max_depth = null) {

    echo "opening directory handle to $basedir/$dir...<br />\n";  // DEBUG 

    $dh = @opendir($basedir . '/' . $dir);
    if ( !$dh ) {
        echo "opendir: FAILED</br />\n"; // DEBUG
        return array();
    }
    echo "opendir: success<br />\n"; //DEBUG
Wenn ich jetzt Verzeichnisse verwalten anwerfe:
In der Liste der verfügbaren Unterverzeichnisse kann durch einen Klick auf einen Verzeichnisnamen ein neuer Ordner unterhalb des gewählten erstellt werden.
opening directory handle to /usr/share/serendipity/www/uploads//...
opendir: FAILED
Stammverzeichnis
:shock:
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Mach mal das "@" vor "opendir" weg in der funktion. Dann müsste es eine ausführlichere fehlermeldung geben.

Aus irgendeinem Grund kann PHP nicht auf das genannte verzeichnis zugreifen.

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tomm
Regular
Posts: 8
Joined: Fri May 04, 2007 9:57 pm
Contact:

Post by tomm »

garvinhicking wrote:Mach mal das "@" vor "opendir" weg in der funktion. Dann müsste es eine ausführlichere fehlermeldung geben.
Warning: opendir(/usr/share/serendipity/www/uploads//) [function.opendir]: failed to open dir: Permission denied in /usr/share/serendipity/www/include/functions_images.inc.php on line 1430
opendir: FAILED

Aaaaalso nochmal langsam:
root@its# ls -ld /usr
drwxr-xr-x 12 root root 4096 Apr 19 2005 /usr/

root@its# ls -ld /usr/share
drwxr-xr-x 136 root root 4096 Apr 25 16:53 /usr/share/

root@its# ls -ld /usr/share/serendipity
drwxr-xr-x 3 root root 4096 Apr 25 14:10 /usr/share/serendipity/

root@its# ls -ld /usr/share/serendipity/www
drwxr-xr-x 8 root root 4096 Apr 25 14:11 /usr/share/serendipity/www/

root@its# ls -ld /usr/share/serendipity/www/uploads
lrwxrwxrwx 1 root root 28 Apr 25 14:11 /usr/share/serendipity/www/uploads -> /var/lib/serendipity/uploads/

root@its# ls -ld /var/lib/serendipity/uploads
drwx-wxr-x 4 root www-data 4096 May 7 12:29 /var/lib/serendipity/uploads/
Autsch! -WX für www-data? :o So eine Sch... :evil:
Also schreiben und abtauchen, aber ned lesen?! chmod... testen... läuft. 8)

Danke fürs Händchenhalten. ;-)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Ah, okay. Mist, das das Vz. ein symbolischer Link sein könnte ist mir entgangen. Schön dass es nun klappt :)

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply