Page not found liferay - url

Some page doesn’t return to hom page afert click and show ok web site error 404 page not foud , doesn’t change the url and Remove path name
I expeted that when click to home page or top menu and mega menu , show the page that i clicked

Related

if user change url in browser and request was Invalid stay in current page in yii2

I want to prevent from IDOR attack in yii2.
If user change url in browser and request was Invalid stay in current page.
I use below code .I stay the current page and dot render page with id manipulate after change Id by firebug in link page.
But if I change id in browser I redirected to home page.
for example, the user(by Yii::$app->user->identity->id that is 19) is on this page : url http://localhost:8080/profile/test/19 and see own profile. if user change url to http://localhost:8080/profile/test/25 in browser and press enter , see the same page again http://localhost:8080/profile/test/19 That is, his profile but I go to home page, I think Yii::$app->request->referrer in empty in this case.
public function actionTest($id) {
if (Yii::$app->user->identity->id == $id) {
return $this->render('view', [
'model' => User::findOne($id),
]);
} else {
$this->goBack(Yii::$app->request->referrer);
}
}

jquery mobile page isn't working with localstorage

Phonegap
Jquery mobile
Not working on chrome browser or iOS.
I'm trying to implement "Recent History" functionality, where if a user visits a page, the page title will be stored in localStorage, then retrieved later.
I have a button on a page, that when clicked adds a (key,value) to localstorage.
$(document).on('tap','#getMeThere',function(){
var title = $('#serviceTitle').text();
var duplicate = false;
for (var i = 0; i < window.localStorage.length; i++){//check if service is already in storage
if(window.localStorage.getItem(window.localStorage.key(i)) == title){
duplicate = true;
break;
}
}
if(duplicate == false){//does not exist in array
window.localStorage.setItem(title,title); //add to local storage
}
});
I have another button on a different page, that when clicked, loads a new page and displays all items in localStorage in a list view.
$(document).on('pagebeforecreate', '#recent', function(){//display services that user has visited
if(window.localStorage.length == 0){
console.log('local storage length=' + window.localStorage.length);
$('#recentEmpty').text("You haven't visited any services yet! Any services you visit will show up on this page.");
}
else{
for (var i = 0; i < window.localStorage.length; i++){
$("#recentList").append($("<li><a href='#ymca' data-transition='slide'>YMCA</a></li>"));
}
console.log('local storage length=' + window.localStorage.length);
}
});
Case 1: The problem is if say i open my app. I click the 2nd button, to see "You haven't visited...". That's fine. Then i go to another page and click the 1st button to add a value to localStorage. When i click the 2nd button again, i'm supposed to see one list item, instead i still see "You haven't visited". Even though i can see while inspecting element that localStorage.setItem was successful and there is 1 value in localStorage. I need to refresh the browser in order to see the list item.
Case 2: I open my app, click the 1st button to add to storage, then click the 2nd button to display it, my recent history page correctly shows 1 list item, without needed to refresh.
It seems to be some sort of caching issue. Or maybe i need to somehow refresh the page?
You are using pagebeforecreate, which is run before the page is created, which happens once. You probably want pagebeforeshow.

Timed click link rather than timed redirect

the action I need is after 1 min (and only once, not every minute), a link click is performed, opening the page. I cannot have this as a page redirect. The reason, the test page you can see below, requires a video background to not start over after the 1 minute AND the page opening with instructions to the user.
I need the action to be the same as if the user clicked the link (if they clicked the link, the page would open and the background video would not start over)
http://kartbattle.com/tester - if you click the link on the top right, the page opens but the video doesn't start over....
if you redirect to the page http://kartbattle.com/tester/?page_id=23 the video starts over which I cannot have happen.
thx!
Using javascript:
setTimeout(function(){window.open('http://kartbattle.com/tester', '_self', '', true)}, 60000);
EDIT:
You will still need to use javascript. First add an id attribute to your hyperlink:
<a id="auto-click" href="http://kartbattle.com/tester/?page_id=23">
then add in the following line to your onLoad handler:
setTimeout(document.getElementById('auto-click').click();, 60000);
this should achieve what you are looking for.

how to get url from browser in blackberry?

In BB when user typed any URL into the browser and hit enter.... then is it possible to get/track/fetch that url..???
shuld i implement any ineterface in my application.......that can track, when user opens the browser and passes a url.
I just want to tell that my application will run in the background......and from background I want to get the URL from BB's native browser. Means when user open the browser and pass a url, I have to get that url and check whether my Application should block that or not.
My application need is -
1) get the url, whatever user have typed in the browser field of the browser...
2) send that url to the server, in the form of xml
3) check response from the server......
4) if response value is "yes" then do nothing...
5) but if response value is "no" then block that URL ( regiseter that - URL into HttpFilterRegistery )
I have develop the code to add my own menu-item into the Browser.
By clicking on that custom-menu-item, I am receiving the URL successfully. But this doesn't meet my requirement actually.
As I told earlier, I want to track the browser application pro-grammatically through a third party application. So Is there any way, whenever Browser app comes to foreground, we can get the menu-item instance of the Browser (native application). So that I can run the custom menu item pro-grammatically.
I have used the following code:
Screen screen = Ui.getUiEngine().getActiveScreen();
System.out.println("\n\n**** " + screen.getClass().getName());
Menu menu = screen.getMenu(1);
for (int i = 0, cnt = menu.getSize(); i < cnt; i++)
System.out.println(" menu item : " + menu.getItem(i).toString());
System.out.println("\n\n");
I am successfully tracking the applications whichever comes to foreground through a background thread of my application, but even then My third party application's thread can't get the menu-instance of the foreground-native applications. It always return the instance of my application's screen...
output of the above code :
** mypackage.AppDemoScreen
menu item : Show Keyboard
menu item : Switch Application
menu item : Full Menu
you can use ApplicationDescriptor , and here is an example to add a new menu item with with the ability to avoid duble the custem menu item , also the code to recept the data from the browser and send it to the class you want
http://pastebin.com/BTSBL8AN

How to load the page as popup dialog without specifying "data-rel" in the caller link

Hi i'm new to Jquery mobile,have some servlet which evaluates username and password from login.html page as,
if(un.equals("user1") && pd.equals("password1")){
RequestDispatcher rd=request.getRequestDispatcher("welcome.html");
rd.forward(request, response);}
else {
RequestDispatcher rd=request.getRequestDispatcher("loginfailed.html");
rd.forward(request, response);}
}
i
what i'm trying is when login fails loginfailed.html should open as a popup dialog showing login failure notice example here. Pls help me to do this..
I've been using this:
http://dev.jtsage.com/jQM-SimpleDialog/
Much easier to open from within javascript than the default jquery-mobile dialog, plus it looks like a dialog in that it does not take up the whole page.

Resources