I want angular routing without hash in Url.
I want Url as http://localhost:56629/Victoria/Home
So Use this Location Provider is to set Html5 mode true.
But Now the Url Becomes http://localhost:56629/Victoria#%2F/Home. i guess it takes the ascii value of ('/')
But the Controversy is that this (Victoria) is Not static Name. this name is Binding with angular Binding.
By Setting Up the Routings On Server Side, this problem is solved
Related
After updated to latest Mac OS (High Sierra 10.13.1), our outlook web add in not function properly, the page is blank, the reason is the url specified in the add-in manifest is not matched by angular route which is further caused by a wrong manipulated url.
The url I specified in the manifest is
https://localhost:4004/#!/main/viewschedule
But the actual I got from window.location.href is:
https://localhost:4004/?_host_Info=Outlook$Mac$16.01$en-US%23!/main/viewschedule
Please note %23 in the url above, that means character '#' has been encoded to %23 which lead angular route does not match routes defined in my application.
We use Angular 1.6, outlook on Mac is 15.40.
We tried to enable html5 mode for angular routing described here. However it looks like outlook office.js could set window.history.pushState to null during its loading. And that history api is a dependence for html5 mode of angular routing.
Question is how can I fix it, can I look forward a future release of outlook to fix this problem?
I'm attempting to implement a way to stop hotlinking and/or un-authorised access to resources within my app.
The method I'm trying to add is something I've used before in PHP apps. Basically a session is set when the page is first called. The images are added to the page via the image tag with the session value as a parameter:
<img src="/files/image/image1.jpg?session=12345" />
When the image is requested the script checks to see if the session is set and matches the provided value. If the condition is not met the serving page returns null. Right at the end to the code I unset the session so further requests from outside the scope of the page will return null.
What would be the best implementation of this method within the lift framework?
Thanks in advance for any help, much appreciated :)
You could use a SessionVar for this purpose. In the SessionVar you’d store a Map[SessionImageId, RealImageId] and upon initialising the Session (i.e. when the page is first loaded) you’d generate some random SessionImageIds which you would map to the real image id. In your html you only expose the shadowed SessionImageId so no-one could trace back the image from the id. When the image is requested, you’d simply look up the real id in the Map.
Info: Exploring Lift, Lift wiki
Of course, if shadowing the ids is not important, you could simply use a SessionVar[Boolean].
I'm trying to add multi language functionality to an existing application.
My URL's look like this:
Without language: www.example.com/controller/action/params
With language: www.example.com/de/controller/action/params
If :lang is not specified ('de' in the example above) it should take the default language (set in the ini) or just use Zend_Translate default keys.
Both of the URL's above need to work.
My Problem now is the following: I'm able to activate get the first URL with the :lang working, but then the default one doesn't work. Why?
Somehow, the chaining of the default route and the language rout doesn't work properly.
My code is the same (for the chaining/routing stuff) like here: http://devzone.zend.com/1765/chaining-language-with-default-route/
I'm not using modules (actively, of course teh default stuff is enabled), maybe my default route (same as in the code) is just wrong? Althought it works, if i disable the language rout and chaining.
I'm developing a multilanguage application, and use routes with translated segments. For multilingual support I created special Multilingual plugin.
To use translated segments I need set translator for Zend_Controller_Router_Route before routes init. So only possible place for this in my plugin is routeStartup method, but there is one problem here - for determine right locale I need to use properties of request (Zend_Controller_Request_Abstract), like module, controller and action names, but they are not defined yet here in routeStartup method. They are already defined, for example, in routeShutdown - but I can't set translator for route there, because it have to be done before routes init.
So what can I do:
can I get request properties somehow in routeStartup
or can I re-setup translator later in routeShutdown
P.S: there is a question with exactly the same problem Zend_Controller_Router_Route: Could not find a translator, but proposed answers is not the option for me, because I can't just retrieve language code from url with Regex, I have much more complicated code to define right language code.
Thanks.
What about putting your code in preDispatch? That's what I personally do when I need to check if the person is logged in. Maybe you can move your code there too?
Follow up to this:
Why can't I pass user sessions between subdomains?
I followed the advice there and used :
ini_set('session.cookie_domain','mydomain');
(with and without a dot before mydomain) as the first line of index.php in the public folder as advised there and in other links around the web.
The problem is that it completely "ruined" Zend_Session_Namespace inside my application.
While it persisted among calls (as it should) of the page, now every time it is being called it is behaving as a new session is being instantiated, without holding all variables.
Any ideas on how to fix this?
Have you tried setting the cookie domain via Zend_Session?
$config['cookie_domain'] = 'mydomain';
Zend_Session::setOptions($config);