/** * Set the user access mechanism initialization string * @param string $userAccessInit * @param string $protocol. Defaults to null in which case we parse it from the init string * @param boolean $set_protocol. Defatuls to false. If true we set the current protocol to be the one we are registering */ public static function setUserAccessInit($userAccessInit, $protocol = null, $set_protocol = false) { if (preg_match('/^([a-z_]+):\\/\\/(.*)/i', $userAccessInit, $matches)) { if ($protocol && $matches[1] != $protocol) { I2CE::raiseError("Invalid init string for protocol {$protocol}"); return; } $protocol = $matches[1]; $init = $matches[2]; } else { $protocol = 'DEFAULT'; $init = $userAccessInit; } if ($protocol == '') { $protocol = 'DEFAULT'; } self::$userAccessInit[$protocol] = $init; if ($set_protocol) { self::$userAccessProtocol = $protocol; } }