Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1293 → Rev 1294

/trunk/includes/functions.inc.php
676,3 → 676,21
$res .= '</ul>';
return $res;
}
 
/**
* @param mixed $mixed
* @return bool
*/
function oidplus_is_true($mixed): bool {
if (is_null($mixed)) {
return false;
} else if (is_string($mixed)) {
return (strtolower($mixed) == 'true') || ($mixed == '1') || (strtolower($mixed) == 'y') || (strtolower($mixed) == 't');
} else if (is_bool($mixed)) {
return $mixed;
} else if (is_numeric($mixed)) {
return $mixed != 0;
} else {
return $mixed ? true : false; // let PHP decide...
}
}
/trunk/plugins/viathinksoft/objectTypes/mac/OIDplusObjectTypePluginMac.class.php
56,7 → 56,7
}
}
 
if ($params['aai_multicast'] == 'true') {
if (oidplus_is_true($params['aai_multicast'] ?? false)) {
$aai[1] = '3';
} else {
$aai[1] = '2';
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php
478,7 → 478,7
}
 
if (isset($params['confidential'])) {
$confidential = $params['confidential'] == 'true';
$confidential = oidplus_is_true($params['confidential']);
OIDplus::db()->query("UPDATE ###objects SET confidential = ? WHERE id = ?", array($confidential, $id));
OIDplusObject::resetObjectInformationCache();
}
582,8 → 582,7
 
// Determine absolute OID name
// Note: At addString() and parse(), the syntax of the ID will be checked
$is_absolute = isset($params['id_fully_qualified']) && $params['id_fully_qualified'] == 'true';;
if ($is_absolute) {
if (oidplus_is_true($params['id_fully_qualified'] ?? false)) {
// For REST API, the ID is absolute (because this is what is in the URL). We need to verify that ID and Parent matches.
$id = $params['id'];
$obj = OIDplusObject::parse($id);
647,7 → 646,7
OIDplus::logger()->log("V2:[INFO]RA(%2)", "Gained ownership of newly created object '%1'", $id, $ra_email);
}
 
$confidential = isset($params['confidential']) && $params['confidential'] == 'true';
$confidential = oidplus_is_true($params['confidential'] ?? false);
$comment = $params['comment'] ?? '';
$title = $params['title'] ?? ''; // This is very special (only useable in REST API): The superior RA can set the title during creation, even if they lose their ownership by delegating afterwards!
$description = $params['description'] ?? ''; // This is very special (only useable in REST API): The superior RA can set the title during creation, even if they lose their ownership by delegating afterwards!
/trunk/plugins/viathinksoft/raPages/100_edit_contact_data/OIDplusPageRaEditContactData.class.php
55,7 → 55,7
if (isset($params['personal_name']))
OIDplus::db()->query("UPDATE ###ra SET personal_name = ? WHERE email = ?", array($params['personal_name'], $email));
if (isset($params['privacy']))
OIDplus::db()->query("UPDATE ###ra SET privacy = ? WHERE email = ?", array($params['privacy'] == 'true', $email));
OIDplus::db()->query("UPDATE ###ra SET privacy = ? WHERE email = ?", array(oidplus_is_true($params['privacy']), $email));
if (isset($params['street']))
OIDplus::db()->query("UPDATE ###ra SET street = ? WHERE email = ?", array($params['street'], $email));
if (isset($params['zip_town']))
141,7 → 141,7
<div><label class="padding_label">'._L('Office').':</label><input type="text" id="office" value="'.htmlentities($row['office']??'').'"/></div>
<div><label class="padding_label">'._L('Person name').':</label><input type="text" id="personal_name" value="'.htmlentities($row['personal_name']??'').'"/></div>
<br>
<div><label class="padding_label">'._L('Privacy').'</label><input type="checkbox" id="privacy" value="" '.($row['privacy'] == 'true' ? ' checked' : '').'/> <label for="privacy">'._L('Hide postal address and Phone/Fax/Mobile Numbers').'</label></div>
<div><label class="padding_label">'._L('Privacy').'</label><input type="checkbox" id="privacy" value="" '.(oidplus_is_true($row['privacy'] ?? false) ? ' checked' : '').'/> <label for="privacy">'._L('Hide postal address and Phone/Fax/Mobile Numbers').'</label></div>
<div><label class="padding_label">'._L('Street').':</label><input type="text" id="street" value="'.htmlentities($row['street']??'').'"/></div>
<div><label class="padding_label">'._L('ZIP/Town').':</label><input type="text" id="zip_town" value="'.htmlentities($row['zip_town']??'').'"/></div>
<div><label class="padding_label">'._L('Country').':</label><input type="text" id="country" value="'.htmlentities($row['country']??'').'"/></div>