mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 15:27:01 +00:00
refactor/moved uri to ObpS
This commit is contained in:
parent
6403921b1c
commit
22c796cb4c
@ -39,7 +39,7 @@ import code.model.{Consumer, TokenType, UserX}
|
||||
import code.nonce.Nonces
|
||||
import code.token.Tokens
|
||||
import code.users.Users
|
||||
import code.util.Helper.MdcLoggable
|
||||
import code.util.Helper.{MdcLoggable, ObpS}
|
||||
import com.openbankproject.commons.model.User
|
||||
import net.liftweb.common._
|
||||
import net.liftweb.http.rest.RestHelper
|
||||
@ -282,7 +282,7 @@ object OAuthHandshake extends RestHelper with MdcLoggable {
|
||||
|
||||
val sRequest = S.request
|
||||
val urlParams: Map[String, List[String]] = sRequest.map(_.params).getOrElse(Map.empty)
|
||||
val sUri = S.uri
|
||||
val sUri = ObpS.uri
|
||||
|
||||
//are all the necessary OAuth parameters present?
|
||||
val missingParams = missingOAuthParameters(parameters,requestType)
|
||||
@ -547,7 +547,7 @@ object OAuthHandshake extends RestHelper with MdcLoggable {
|
||||
|
||||
val sRequest = S.request
|
||||
val urlParams: Map[String, List[String]] = sRequest.map(_.params).getOrElse(Map.empty)
|
||||
val sUri = S.uri
|
||||
val sUri = ObpS.uri
|
||||
|
||||
// Please note that after this point S.request for instance cannot be used directly
|
||||
// If you need it later assign it to some variable and pass it
|
||||
|
||||
@ -26,6 +26,7 @@ TESOBE (http://www.tesobe.com/)
|
||||
*/
|
||||
package code.model.dataAccess
|
||||
|
||||
import code.util.Helper.ObpS
|
||||
import net.liftweb.mapper._
|
||||
import net.liftweb.common._
|
||||
import net.liftweb.http.SessionVar
|
||||
@ -68,7 +69,7 @@ object Admin extends Admin with MetaMegaProtoUser[Admin]{
|
||||
}
|
||||
|
||||
override def loginXhtml = {
|
||||
(<form method="post" action={S.uri}><table><tr><td
|
||||
(<form method="post" action={ObpS.uri}><table><tr><td
|
||||
colspan="2">Admin Log In</td></tr>
|
||||
<tr><td>{userNameFieldString}</td><td><user:email /></td></tr>
|
||||
<tr><td>{S.?("password")}</td><td><user:password /></td></tr>
|
||||
|
||||
@ -435,7 +435,7 @@ import net.liftweb.util.Helpers._
|
||||
|
||||
override def loginXhtml = {
|
||||
val loginXml = Templates(List("templates-hidden","_login")).map({
|
||||
"form [action]" #> {S.uri} &
|
||||
"form [action]" #> {ObpS.uri} &
|
||||
"#loginText * " #> {S.?("log.in")} &
|
||||
"#usernameText * " #> {S.?("username")} &
|
||||
"#passwordText * " #> {S.?("password")} &
|
||||
@ -583,7 +583,7 @@ import net.liftweb.util.Helpers._
|
||||
<div id="recover-password" tabindex="-1">
|
||||
<h1>Recover Password</h1>
|
||||
<div id="recover-password-explanation">Enter your email address or username and we'll email you a link to reset your password</div>
|
||||
<form action={S.uri} method="post">
|
||||
<form action={ObpS.uri} method="post">
|
||||
<div class="form-group">
|
||||
<label>Username or email address</label> <span id="recover-password-email"><input id="email" type="text" /></span>
|
||||
</div>
|
||||
@ -744,7 +744,7 @@ import net.liftweb.util.Helpers._
|
||||
|
||||
override def signupXhtml (user:AuthUser) = {
|
||||
<div id="signup" tabindex="-1">
|
||||
<form method="post" action={ObpS.uriAndQueryString.getOrElse(S.uri)}>
|
||||
<form method="post" action={ObpS.uriAndQueryString.getOrElse(ObpS.uri)}>
|
||||
<h1>{signupFormTitle}</h1>
|
||||
{legalNoticeDiv}
|
||||
<div id="signup-general-error" class="alert alert-danger hide"><span data-lift="Msg?id=error"/></div>
|
||||
@ -1539,7 +1539,7 @@ def restoreSomeSessions(): Unit = {
|
||||
override def passwordResetXhtml = {
|
||||
<div id="recover-password" tabindex="-1">
|
||||
<h1>{if(ObpS.queryString.isDefined) Helper.i18n("set.your.password") else S.?("reset.your.password")}</h1>
|
||||
<form action={S.uri} method="post">
|
||||
<form action={ObpS.uri} method="post">
|
||||
<div class="form-group">
|
||||
<label for="password">{S.?("enter.your.new.password")}</label> <span><input id="password" class="form-control" type="password" /></span>
|
||||
</div>
|
||||
|
||||
@ -26,6 +26,7 @@ TESOBE (http://www.tesobe.com/)
|
||||
*/
|
||||
|
||||
package code.snippet
|
||||
import code.util.Helper.ObpS
|
||||
import net.liftweb.http.S
|
||||
import net.liftweb.http.LiftRules
|
||||
import net.liftweb.util.Helpers._
|
||||
@ -72,7 +73,7 @@ class Nav {
|
||||
}
|
||||
|
||||
def markIfSelected(href : String) : Box[String]= {
|
||||
val currentHref = S.uri
|
||||
val currentHref = ObpS.uri
|
||||
if(href.equals(currentHref)) Full("selected")
|
||||
else Empty
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ class WebUI extends MdcLoggable{
|
||||
val hyphenLocale = locale.replace("_", "-")
|
||||
if (supportedLocales.contains(locale) || supportedLocales.contains(hyphenLocale) ) {""} else {"none"}
|
||||
}
|
||||
val page = Constant.HostName + S.uri
|
||||
val page = Constant.HostName + ObpS.uri
|
||||
val language = I18NUtil.currentLocale().getLanguage()
|
||||
|
||||
"#es a [href]" #> scala.xml.Unparsed(s"${page}?${replaceLocale("locale=es_ES")}") &
|
||||
|
||||
@ -483,8 +483,15 @@ object Helper extends Loggable {
|
||||
logger.debug(s"ObpS.${methodName} validation failed. The input key is: ${if (args.length>0)args.apply(0) else ""}, value is:$result")
|
||||
}
|
||||
resultAfterChecked
|
||||
} else if (methodName.equals("uri") && result.isInstanceOf[String] ||
|
||||
methodName.equals("uriAndQueryString") && result.isInstanceOf[Box[String]] && result.asInstanceOf[Box[String]].isDefined ||
|
||||
} else if (methodName.equals("uri") && result.isInstanceOf[String]){
|
||||
val resultAfterChecked = Full(result.asInstanceOf[String]).filter(APIUtil.basicUriAndQueryStringValidation(_))
|
||||
if(resultAfterChecked.isDefined) {
|
||||
resultAfterChecked.head
|
||||
}else{
|
||||
logger.debug(s"ObpS.${methodName} validation failed. The value is:$result")
|
||||
resultAfterChecked.getOrElse("")
|
||||
}
|
||||
} else if (methodName.equals("uriAndQueryString") && result.isInstanceOf[Box[String]] && result.asInstanceOf[Box[String]].isDefined ||
|
||||
methodName.equals("queryString") && result.isInstanceOf[Box[String]]&&result.asInstanceOf[Box[String]].isDefined){
|
||||
val resultAfterChecked = result.asInstanceOf[Box[String]].filter(APIUtil.basicUriAndQueryStringValidation(_))
|
||||
if(resultAfterChecked.isEmpty) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user