User Tools

Site Tools


cern:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cern:index [2023/09/29 17:29] iwncern:index [2023/10/04 16:10] (current) iwn
Line 5: Line 5:
 preg_match("|^(\w+)\.|",$_SERVER["SERVER_NAME"],$usr); // get username from hostname $USER.web.cern.ch preg_match("|^(\w+)\.|",$_SERVER["SERVER_NAME"],$usr); // get username from hostname $USER.web.cern.ch
 $pwd = preg_replace("|^((\w)\w+)|","/eos/user/$2/$1/www/",$usr[1]); // get base path $pwd = preg_replace("|^((\w)\w+)|","/eos/user/$2/$1/www/",$usr[1]); // get base path
-$pwd = $pwd.preg_replace("|^(?:\/$usr[1]\/)?([^\?]*)(?:\?.*)?$|","$1",$_SERVER["REQUEST_URI"]); // get subdirectory +$pwd = $pwd.preg_replace("|^\/(?:$usr[1]\/)?([^\?]*)(?:\?.*)?$|","$1",$_SERVER["REQUEST_URI"]); // get subdirectory
-//$pwd = $pwd.preg_replace("|(?<=\/)\?.*|","",$_SERVER["REQUEST_URI"]); // remove question mark+
 $pwdshort = preg_replace("(.*www\/)","$usr[1]/",$pwd); $pwdshort = preg_replace("(.*www\/)","$usr[1]/",$pwd);
 if(!chdir($pwd)) { // try to go to directory if(!chdir($pwd)) { // try to go to directory
cern/index.1696001398.txt.gz · Last modified: 2023/09/29 17:29 by iwn