Skip to content
Snippets Groups Projects
Commit 59d65f99 authored by Martin Haase's avatar Martin Haase
Browse files

minor mods

git-svn-id: https://textgridlab.org/svn/textgrid/trunk/middleware/tgauth@7520 7c539038-3410-0410-b1ec-0f2a7bf1c452
parent 734cf999
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,11 @@ foreach ($attributes as $a) { ...@@ -67,6 +67,11 @@ foreach ($attributes as $a) {
} }
} }
$file = fopen ("/tmp/xxxUR.log", "w+");
fwrite ($file, "putting these attrs: ". serialize ($newattributes) ."\n");
fclose ($file);
$res = $rbac->setAttributes($newattributes, $Sid, $loginmode ); $res = $rbac->setAttributes($newattributes, $Sid, $loginmode );
if ((is_array($res) && $res['success'] == FALSE) || (is_object($res) && $res->result == FALSE)) { if ((is_array($res) && $res['success'] == FALSE) || (is_object($res) && $res->result == FALSE)) {
echo "something went wrong". serialize($res); echo "something went wrong". serialize($res);
......
...@@ -73,11 +73,10 @@ if (isset ($_SERVER["REMOTE_USER"])) { // this holds for shib, too ...@@ -73,11 +73,10 @@ if (isset ($_SERVER["REMOTE_USER"])) { // this holds for shib, too
); );
if (!isset ($ldap)) { if (!isset ($ldap)) {
$ProvidedAttributes = Array(); $ProvidedAttributes = Array();
if (isset($_SERVER["givenName"])) { $ProvidedAttributes['givenName'] = $_SERVER["givenName"];} // this is the list of attributes Shibboleth might give to us except from remote_user
if (isset($_SERVER["sn"])) { $ProvidedAttributes['sn'] = $_SERVER["sn"];} foreach (array ("o", "sn", "givenName", "cn", "mail") as $a) {
if (isset($_SERVER["cn"])) { $ProvidedAttributes['cn'] = $_SERVER["cn"];} if (isset($_SERVER[$a])) { $ProvidedAttributes[$a] = $_SERVER[$a];}
if (isset($_SERVER["mail"])) { $ProvidedAttributes['mail'] = $_SERVER["mail"];} }
if (isset($_SERVER["o"])) { $ProvidedAttributes['o'] = $_SERVER["o"];}
} }
} }
// This is Variant 3: No Session Creation, but just a desire to see (and update) User Attributes // This is Variant 3: No Session Creation, but just a desire to see (and update) User Attributes
...@@ -85,7 +84,7 @@ else if (isset ($_REQUEST["Sid"]) && strlen($_REQUEST["Sid"]) > 0 ) { ...@@ -85,7 +84,7 @@ else if (isset ($_REQUEST["Sid"]) && strlen($_REQUEST["Sid"]) > 0 ) {
// we might have come directly here using the sid and use an earlier session // we might have come directly here using the sid and use an earlier session
$Sid = $_REQUEST["Sid"]; $Sid = $_REQUEST["Sid"];
} else { } else {
trigger_error("WebAuth does not know what to do, exiting.", E_USER_WARNING); trigger_error("WebAuth does not know what to do (no login provided, no remote user, and no session Id), exiting.", E_USER_WARNING);
exit; exit;
} }
......
...@@ -178,8 +178,10 @@ class WebUtils { ...@@ -178,8 +178,10 @@ class WebUtils {
if (isset ($a->value)) { if (isset ($a->value)) {
$oldval = $a->value; $oldval = $a->value;
} }
$providedreadonly = "";
if (isset($attrMap[$a->name]) && isset($providedAttrs[$attrMap[$a->name]])) { if (isset($attrMap[$a->name]) && isset($providedAttrs[$attrMap[$a->name]])) {
$oldval = $providedAttrs[$attrMap[$a->name]]; $oldval = $providedAttrs[$attrMap[$a->name]];
$providedreadonly = " readonly=\"readonly\"";
} }
if ($this->isBoolean ($a)) { if ($this->isBoolean ($a)) {
if ($oldval === "TRUE") { if ($oldval === "TRUE") {
...@@ -203,7 +205,7 @@ class WebUtils { ...@@ -203,7 +205,7 @@ class WebUtils {
$this->formatISO3166list( $a->name, $oldval); $this->formatISO3166list( $a->name, $oldval);
echo "</td>\n"; echo "</td>\n";
} else { // assume string } else { // assume string
echo "<td><input type=\"text\" size=\"50\" name=\"". $a->name . "\" value=\"". $oldval ."\"/></td>\n"; echo "<td><input type=\"text\" size=\"50\" name=\"". $a->name . "\" value=\"${oldval}\"${providedreadonly}/></td>\n";
} }
echo "<td><div onmouseover=\"this.innerHTML = '". $a->description ."'\"\n"; echo "<td><div onmouseover=\"this.innerHTML = '". $a->description ."'\"\n";
echo " onmouseout=\"this.innerHTML = '?'\"> ?</div></td></tr>\n"; echo " onmouseout=\"this.innerHTML = '?'\"> ?</div></td></tr>\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment