/trunk/plugins/viathinksoft/publicPages/001_ra_base/OIDplusPagePublicRaBaseUtils.class.php |
---|
27,18 → 27,11 |
class OIDplusPagePublicRaBaseUtils extends OIDplusPagePluginPublic { |
/** |
* @param string $actionID |
* @param array $params |
* @param array $params email |
* @return array |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
// Action: delete_ra |
// Method: POST |
// Parameters: email |
// Outputs: Text |
if ($actionID == 'delete_ra') { |
private function action_Delete(array $params): array { |
_CheckParamExists($params, 'email'); |
$email = $params['email']; |
61,10 → 54,20 |
OIDplus::logger()->log("V2:[OK/WARN]RA(%1)+[OK/INFO]A", "RA '%1' deleted", $email); |
return array("status" => 0); |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'delete_ra') { |
return $this->action_Delete($params); |
} else { |
return parent::action($actionID, $params); |
} |
} |
/** |
/trunk/plugins/viathinksoft/publicPages/090_login/OIDplusPagePublicLogin.class.php |
---|
26,15 → 26,11 |
class OIDplusPagePublicLogin extends OIDplusPagePluginPublic { |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
// === RA LOGIN/LOGOUT === |
if ($actionID == 'ra_login') { |
private function action_RaLogin(array $params): array { |
OIDplus::getActiveCaptchaPlugin()->captchaVerify($params, 'captcha'); |
_CheckParamExists($params, 'email'); |
72,9 → 68,14 |
} |
throw new OIDplusException(_L('Wrong password or user not registered')); |
} |
} |
} else if ($actionID == 'ra_logout') { |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
private function action_RaLogout(array $params): array { |
_CheckParamExists($params, 'email'); |
$email = $params['email']; |
84,9 → 85,12 |
return array("status" => 0); |
} |
// === ADMIN LOGIN/LOGOUT === |
else if ($actionID == 'admin_login') { |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
private function action_AdminLogin(array $params): array { |
OIDplus::getActiveCaptchaPlugin()->captchaVerify($params, 'captcha'); |
_CheckParamExists($params, 'password'); |
104,12 → 108,34 |
throw new OIDplusException(_L('Wrong password')); |
} |
} |
else if ($actionID == 'admin_logout') { |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
private function action_AdminLogout(array $params): array { |
OIDplus::authUtils()->adminLogoutEx(); |
return array("status" => 0); |
} |
else { |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'ra_login') { |
return $this->action_RaLogin($params); |
} else if ($actionID == 'ra_logout') { |
return $this->action_RaLogout($params); |
} else if ($actionID == 'admin_login') { |
return $this->action_AdminLogin($params); |
} else if ($actionID == 'admin_logout') { |
return $this->action_AdminLogout($params); |
} else { |
return parent::action($actionID, $params); |
} |
} |
/trunk/plugins/viathinksoft/publicPages/091_forgot_password/OIDplusPagePublicForgotPassword.class.php |
---|
26,14 → 26,12 |
class OIDplusPagePublicForgotPassword extends OIDplusPagePluginPublic { |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'forgot_password') { |
private function action_Request(array $params): array { |
_CheckParamExists($params, 'email'); |
$email = $params['email']; |
53,9 → 51,15 |
OIDplus::mailUtils()->sendMail($email, OIDplus::config()->getValue('system_title').' - Password reset request', $message); |
return array("status" => 0); |
} |
} else if ($actionID == 'reset_password') { |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
private function action_Activate(array $params): array { |
_CheckParamExists($params, 'password1'); |
_CheckParamExists($params, 'password2'); |
_CheckParamExists($params, 'email'); |
85,6 → 89,20 |
$ra->change_password($password1); |
return array("status" => 0); |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'forgot_password') { |
return $this->action_Request($params); |
} else if ($actionID == 'reset_password') { |
return $this->action_Activate($params); |
} else { |
return parent::action($actionID, $params); |
} |
/trunk/plugins/viathinksoft/publicPages/095_attachments/OIDplusPagePublicAttachments.class.php |
---|
174,15 → 174,13 |
return OIDplus::config()->getValue('attachments_allow_ra_upload', 0); |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'deleteAttachment') { |
private function action_Delete(array $params): array { |
_CheckParamExists($params, 'id'); |
$id = $params['id']; |
$obj = OIDplusObject::parse($id); |
222,8 → 220,14 |
OIDplus::logger()->log("V2:[OK]OID(%1)+[OK/INFO]OIDRA(%1)+[OK/INFO]A", "Deleted attachment '%2' from object '%1'", $id, basename($uploadfile)); |
return array("status" => 0); |
} |
} else if ($actionID == 'uploadAttachment') { |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
private function action_Upload(array $params): array { |
_CheckParamExists($params, 'id'); |
$id = $params['id']; |
$obj = OIDplusObject::parse($id); |
308,6 → 312,19 |
OIDplus::logger()->log("V2:[OK]OID(%1)+[OK/INFO]OIDRA(%1)+[OK/INFO]A", "Uploaded attachment '%2' to object '%1'", $id, basename($uploadfile)); |
return array("status" => 0); |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'deleteAttachment') { |
return $this->action_Delete($params); |
} else if ($actionID == 'uploadAttachment') { |
return $this->action_Upload($params); |
} else { |
return parent::action($actionID, $params); |
} |
/trunk/plugins/viathinksoft/publicPages/200_viathinksoft_freeoid/OIDplusPagePublicFreeOID.class.php |
---|
55,16 → 55,14 |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
public function action(string $actionID, array $params): array { |
private function action_Request(array $params): array { |
if (empty(self::getFreeRootOid(false))) throw new OIDplusException(_L('FreeOID service not available. Please ask your administrator.')); |
if ($actionID == 'request_freeoid') { |
_CheckParamExists($params, 'email'); |
$email = $params['email']; |
92,8 → 90,17 |
OIDplus::mailUtils()->sendMail($email, OIDplus::config()->getValue('system_title').' - Free OID request', $message); |
return array("status" => 0); |
} |
} else if ($actionID == 'activate_freeoid') { |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
private function action_Activate(array $params): array { |
if (empty(self::getFreeRootOid(false))) throw new OIDplusException(_L('FreeOID service not available. Please ask your administrator.')); |
_CheckParamExists($params, 'email'); |
_CheckParamExists($params, 'auth'); |
197,6 → 204,20 |
"new_oid" => $new_oid, |
"status" => 0 |
); |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'request_freeoid') { |
return $this->action_Request($params); |
} else if ($actionID == 'activate_freeoid') { |
return $this->action_Activate($params); |
} else { |
return parent::action($actionID, $params); |
} |
/trunk/plugins/viathinksoft/publicPages/300_search/OIDplusPagePublicSearch.class.php |
---|
164,6 → 164,16 |
} |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
*/ |
private function action_Search(array $params): array { |
$ret = $this->doSearch($params); |
return array("status" => 0, "output" => $ret); |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
170,15 → 180,11 |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'search') { |
// Search with JavaScript/AJAX |
$ret = $this->doSearch($params); |
return array("status" => 0, "output" => $ret); |
return $this->action_Search($params); |
} else { |
return parent::action($actionID, $params); |
} |
} |
/** |
/trunk/plugins/viathinksoft/publicPages/800_login_ldap/OIDplusPagePublicLoginLDAP.class.php |
---|
117,14 → 117,12 |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusConfigInitializationException |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'ra_login_ldap') { |
private function action_Login(array $params): array { |
if (!OIDplus::baseConfig()->getValue('LDAP_ENABLED', false)) { |
throw new OIDplusException(_L('LDAP authentication is disabled on this system.')); |
} |
224,6 → 222,18 |
} |
return array("status" => 0); |
} |
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusConfigInitializationException |
* @throws OIDplusException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'ra_login_ldap') { |
return $this->action_Login($params); |
} else { |
return parent::action($actionID, $params); |
} |