w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Dynamic tab content and params
In tabs-directive.html, you can definitely use ngBindHtmlUnsafe. Make sure don't put {{}} around the variable. String: <div ng-bind-html-unsafe="tab.content"></div>

Categories : Angularjs

Using ActionForward with dynamic params in Struts 2
You could use a dynamic parameters with a result, see the dynamic result configuration. In the action you should write a getter for the patrameter private String actionUrl; public String getActionUrl() { return actionUrl; } and configure result <action name="create" class="CreateAction"> <result type="redirect">${actionUrl}</result> </action> So, the common sense would be rewrite the code like public class CreateAction extends ActionSupport { private String actionUrl; public String getActionUrl() { return actionUrl; } @Override public String execute() throws Exception { String actionPath = "/view"; String createType = req.getParameter("createType"); String params = "&action=v

Categories : Java

rails 4 strong params + dynamic hstore keys
If I understand correctly, you would like to whitelist a hash of dynamic keys. You can use some ruby code as follows to do this: params.require(:article).permit(:name).tap do |whitelisted| whitelisted[:content] = params[:article][:content] end This worked for me, hope it helps!

Categories : Ruby On Rails

Rails4: How to permit hash with dynamic keys in params?
by design strong params doesn't allow hashes with dynamic keys as values, so.. in this case you need to whitelist files manually. params.require(:post).tap do |whitelisted| whitelisted[:files] = params[:post][:files] end

Categories : Ruby On Rails

dynamic vs object keyword on method params and return type
Depending on the {... } they certainly don't lead to the same IL! Consider: public object Foo(object bar) { Use(bar); } void Use(int i) { } void Use(string s) { } void Use(IConvertible c) { } void Use<T>(IEnumerable<T> e) { } void Use(object o) { } The IL will simply contain a call to the last overload of Use. But had the parameter been declared as dynamic bar instead, the IL would contain code to start up the very complex overload resolution algorithm. This could lead to any of the overloads being called, or might lead to an error (for example with bar==null, the best overload cannot be determined). Clearly very different IL. Clearly the performance is worse when we have to do the whole binding when the application runs (dynamic), instead of doing it once and for all w

Categories : C#

Preventing Multiple Login with same login credentials
Simply have a field in your database that has text that says online or offline for each user, according to whether they are logged in or not. So when someone tries to log in with that username, check the database if the field says online for that given user on submit. If the field says online, don't allow log in. Otherwise permit it. without using a database you can store if a user is online in a text file $check= "onlineCheck.txt"; $fh = fopen($check, 'a') or die("can't open file"); $nowOnline= "USER678 "; fwrite($fh, $nowOnline);

Categories : Java

Reverse url with multiple optional params
Try this: url( r'^events/(?:(?P<year>d{4})/)?(?:(?P<month>d{2})/)?(?:(?P<day>d{2})/)?(?:(?P<company_uuid>[a-f0-9-]{36})/)?$', 'events', name='events'), I have done following changes. Simplified the company_uuid pattern, you can switch back to yours if you want When you have day, month, year you should display URL more nicely e.g events/2013/12/01/ instead of events/20131201/ Changed the hierarchy to year -> month -> day instead of day -> month -> year Following patterns will match: events/{year}/ events/{year}/{month}/ events/{year}/{month}/{day}/ events/{year}/{month}/{day}/{company_uuid}/ And many more In Template now you can do For this URL and in general also you should always use named groups {% url 'events' year=2013 %} {% url

Categories : Django

How can I pass multiple params into a directive?
Use multiple attributes. Your directive has access to all attributes used in the element: <div my-directive arg-one='abcd', arg-two>xx</div> app.directive('myDirective', function () { return { link: function ($scope, elm, attr, ngModel) { var abc=attr.argOne; var def=attr.argTwo; } }; }); Notice the change from - to camelCase. This is done by AngularJS.

Categories : Angularjs

looking for best way of giving command line arguments in python, where some params are req for some option and some params are req for other options
This variation on your script runs, and cleans up several things. It uses choices to control the options values. It omits unnecessary parameters in the other add_argument calls. It simplifies the post parse_args logic. help isn't really needed since there is always the -h option, but I included it as a choice. It falls through to the end because it is not in the action dictionary. import argparse import sys class Stub(object): def __init__(self,s): self.s = s def __call__(self,conf_file, jobid): print self.s, conf_file, jobid parser = argparse.ArgumentParser(description='Usage options.') parser.add_argument('-o','--options', choices=('run','rerun','kill', 'resume', 'suspend','help'),required=True) parser.add_argument('-c', '--config',help='config file input') #

Categories : Python

Taking saved Rails Params from string back to Params
What specifically is giving you trouble? If you have data = {"utf8"=>"✓", "authenticity_token"=>"XXXX...=", "focus_group_invite_url_code"=>"XXXXXXX", "event_group_id"=>{"-1"=>""}, "event"=>{"id"=>"-1"}, "spouse"=>{"name"=>""}, "email"=>{"address"=>"XXXX@XXXX.com"}, "phone"=>{"number"=>"5555551212"}, "commit"=>"RSVP", "action"=>"create", "controller"=>"my_controller"} you can do things like data["authenticity_token"] #=> "XXXX...=" data["event"]["id"] #=> "-1" data["phone"]["number"].to_i #=> 5555551212 and so on...

Categories : Ruby On Rails

What type is Params in Android's AsyncTask->execute(Params...)
From what I understand here and here, you should try code like this: // ObjAT is the runtime-determined AsyncTask object. Method method = objAT.getClass().getMethod("execute", Object[].class);

Categories : Java

Dynamic home page after login
Not sure what answer you're expecting. You need some mechanism to determine which page to send to the user based on some criteria. Either way, it will end similarly to what you've shown as an example "you don't like". What I've suggest would be to group users and check for that group instead. For instance: if (user.IsMemberOf("some group") { // perform some steps and redirect }

Categories : Asp Net

rails input selected values from params to select_tag (multiple => true)
Ref this and options_for_select Something like following <%= select_tag 'values[]', options_for_select(@stores.map {|s| [s.store_name, s.store_id]}, @user.stores.map {|j| j.store_id}), :class => 'some-class', :multiple => true, :size => 6 %>

Categories : Ruby On Rails

Strong params rails 4 permitting params
You likely need to add this as a hidden attribute on your form, like so: <input type="hidden" name="ticket[project_id]" value="<%= @ticket.project_id %>" /> Then in the controller you can do this: params.require(:ticket).permit(:name,:project_id) Here is a helpful link: https://github.com/rails/strong_parameters

Categories : Ruby On Rails

How to send files and data from form with multiple divs and multiple dynamic elements as shown below?
Maybe this way will be better $(document).ready(function() { // submitting $('#upload-form').on('submit', function() { // get values var answer = $("#album_name").val(); // if empty if(answer == '') { alert('write album name'); } else { // ajax $.ajax({ url: $(this).attr('action'), // path for submit (upload.php) type: $(this).attr('method'), // here is post data: $(this).serialize(), // put all values into $_POST success: function(html) { // I get answer from upload.php alert(html); } }); } return false; // for not submitting the form }); });

Categories : PHP

Multiple Session Login
I had this same exact requirement. I had to make sure that user ID's were logged in from just one device at a time. When a user ID tried to log in to another device while still logged in to an existing device, it killed the session on their existing device while allowing them to log-in to the new device. I wrote up a solution on my original post on Stack Overflow: When the same user ID is trying to log in on multiple devices, how do I kill the session on the other device?

Categories : C#

multiple login page in asp.net mvc
One way is just to create different login controllers for each role type. To make it possible for people to access two different login pages while they are not logged in, you can open up those locations in web.config: <location path="Employee/Login"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="Customer/Login"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> You say that when people get logged out they can be redirected to the home page. To do this, in the forms authentication portion of web.config, set loginUrl to your home page. If y

Categories : Asp Net Mvc

Multiple Forms with one login
I think you're possibly over-thinking this. I'd put the username and password inputs into a single form and have both submit buttons displayed as follows: <form action="test.asp?f=test1" method="post"> <input name="username" /> <input name="password" type="password" /> <input id="submit-1" type="button" value="Submit One" /> <input id="submit-2" type="button" value="Submit Two" /> </form> Then, using JavaScript I'd wire up click event handlers on each button such that when the user click either one, the form action URL querystring would be updated before submitting the form. var button1 = document.getElementById("submit-1"); var button2 = document.getElementById("submit-2"); b1.onclick = function() { document.form.action = "t

Categories : Javascript

Automatic login multiple web application
You want to create something like StackExchange authentication system. You can use cookies to save data in it. e.g You can create Login cookie for about 3 days life time. It means that your users can login for about 3 days. Cookies are not safe (specially for storing important datas like passwords). To secure cookies you can hash your data. But even doing this the user can delete cookies from browser; Or if user clean its browser history on exit, cookies will be deleted. Here web have code for creating cookies: HttpCookie loginCookie = new HttpCookie("LoginCookie"); After that you can set cookie expires (life time): loginCookie.Expires = DateTime.Now.AddDays(3); And you can insert data in it: loginCookie.Values.Add("password", "Hashed value of password here"); For Logout: Cr

Categories : Security

IOS : Multiple storyboards (one for the login/signup, one for the main app)
I would suggest only having separate storyboards if it becomes an issue for you. I have gone down the path of having separate storyboards, and didn't find any advantage organizationally. It wasn't worth keeping track of which view was in which storyboard. Once you move to a universal app it is probably more useful to have one storyboard for iPhone and one for iPad. I currently have 3 storyboards, and they are not organized according to what type of view, but which environment will be using the views. iPhone Storyboard iPad Storyboard Shared Storyboard(some views you will use between both) For me, storyboards are nothing more than just a container to dump my views, and prevents a bunch of separate .xib files all over the place(initialization of ViewControllers from the storyboard is mu

Categories : IOS

Common Login for multiple WinRT apps
Impliment a Cookie Mechanizem like http://en.wikipedia.org/wiki/HTTP_cookie for example when user logins to app save in registry username and randomly generated GUID save the same GUID in the server along with expire date. every time a user tries to login check in registry for Cookie entry and if found send to the server your username and GUID if GUID is valid and cookie not expired allow login.

Categories : C#

Create one single controller.php or have multiple like "login.php" for example
Controllers usually are not just a single action. Controllers represent a group of actions for a specific module. For instance, a user controller would have typical CRUD actions, and then maybe a login/logout action, and possibly a register(under create maybe) or forgot password action. If you are making a blog, a post/entry controller would most likely just have the typical CRUD actions and maybe a comment action. So basically one controller per module or per model even. All your controllers should extend a similar base, but it doesn't have to be the same for the entire project. Your forms would look like: action="controllerName/actionName" or action="controller.php?q=controllerName/actionName depending on how you have the mod-rewrite setup. As far as views, each controller actio

Categories : PHP

Pull from multiple tables in my login script
$res = mysql_query("SELECT * FROM `affiliate_tasks` WHERE `username` = '".$username."'"); $_SESSION['task_name'] = $row['task_name']; Your not actually doing anything with $res to turn it into $row inserting $row = mysql_fetch_assoc($res); between the 2 lines should fix it. if not there is a problem with the SQL Also avoid uing mysql_, instead use PDO or mysqli_ update: Give this a go $aff_tasks = mysql_query("SELECT * FROM `affiliate_tasks` WHERE `username` = '".$username."'"); $row_tasks = mysql_fetch_assoc($aff_tasks); $_SESSION['task_name'] = $row_tasks['task_name']; $_SESSION['due_date'] = $row_tasks['due_date']; $_SESSION['status'] = $row_tasks['status'];

Categories : PHP

VBS- Login script to map drive with multiple NICs
You use arrSubnets without initializing (or resizing) it. Also, you're trying to echo arrSubnetIPs(i) when you should be echoing arrSubnets(i). Change this: i = 0 For Each objAdapter in colAdapters For Each strAddress in objAdapter.IPAddress arrOctets = Split(strAddress, ".") If arrOctets(0) <> "" Then arrSubnets(i) = arrOctets(0) & "." & arrOctets(1) & "." & arrOctets(2) i = i + 1 WScript.Echo arrSubnetIPs(i) End If Next Next into this: ReDim arrSubnets(-1) For Each objAdapter in colAdapters For Each strAddress in objAdapter.IPAddress arrOctets = Split(strAddress, ".") If arrOctets(0) <> "" Then ReDim Preserve arrSubnets(UBound(arrSubnets)+1) arrSubnets(UBound(arrSubnets)) = arrOctets(0) & "." &am

Categories : Authentication

How to secure multiple applications via one session login
If you are using Forms Authentication, you can set the domain and the name of the cookie in your web.config file in each application as follows: <configuration> <system.web> <authentication mode="Forms"> <forms name="MyCookieName" domain="mydomain.com" /> </authentication> </system.web> </configuration>

Categories : Asp Net

Identity Server v2 Multiple Origin Login
Sounds like each of those needs to be a separate RP configured in your STS. Then if/when RP1 wants to send the user to RP2, it can do the redirect. Once they land on RP2, it will trigger authentication to the STS and they will still be logged in which will issue the token to RP2. Recall one goal of federation is SSO. I don't see why IdentityServer needs to be involved with the redirect at all.

Categories : Asp Net

Facebook Login with multiple completely different domains
I also had same problem.So i just came out with redirecting user to my root domain & when user is authenticated redirect to request domain's main page with encrypted data & a little user's info(if you wish you can provide user info by api access). Encryption should be strong enough & should depend on date time....to make hard for recognizing...& then store data in sessions ,from main page redirecting user to requested page. In whole process you will have to preserve the url from which user is redirected.

Categories : PHP

Handling Login on Multiple Devices using Parse iOS
You can generate a unique identifier for each installation of your game (just a UUID stored in user defaults). Each time a use logs in, update the identifier into your user information stored on the server. When you upload any edit to the server you can send the identifier and check it with cloud code (or check the identifier first) to decide if the login is still valid. How you check depends on what you want to do if you find the login to be invalid. The more efficient route is to use cloud code and send back an error response that the app handles to alert the user and action the logout.

Categories : IOS

Java Applet/Multiple Class Login
Let's start with, this is not how Applets are used, in for that fact, how UI's are used... You problem stems from the fact that you seem "think" you control the paint process... objectName.paint(null); But you are passing a null value to the paint method. Apart from the fact that you should never have a need to call paint directly, I'm not sure what you expected paint to do... public void paint(Graphics g){ g.drawLine(10, 20, 50, 60 ); } g is null... Firstly, forget about applets, seriously, UI's and Swing are complicated enough with adding the complexity of applets to the problem. Secondly, take a read through Creating a GUI with Swing... Swing has it's own mechanisms for getting user input, so you can drop the Scanner...

Categories : Java

How to prevent user to login from multiple location or from different browser in same pc
In your Global.asax file you have Session_OnEnd() public void Session_OnEnd() { // Set flag to 0 } This will be okay if your sessionState is set to INPROC (Which is the default setting), if you have manually adjsuted it to StateServer or SQL Server then this event will be ignored. When the browser closes the window you can do use onbeforeunload in JavaScript window.onbeforeunload = function(e) { // call an Ajax function to reset the state. };

Categories : C#

Login to multiple hosts and executing command in Unix
You could do this in you script: $ ssh loessl.org df Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda2 103212320 52448972 45520468 54% / [..] and/or have a look at pconsole

Categories : Unix

OPENAM - amService-UrlAccessAgent Login multiple Times
There are a couple of interesting things in your description: If you are using a web agent, then why are using it with amService-UrlAccessAgent? You should create a Web agent profile for your agent and use that account instead. It's not clear what web server are you using, so I'm assuming it's Apache. In that case make sure that you are NOT using prefork mode, the recommended mpm is worker, because it will require much less agent login in general. Nevertheless as far as I know the agent always logs itself out once the child process dies. You may also want to try to use a newer version of the webagent, or even a nightly if this problem keeps reoccurring.

Categories : Security

Restrict multiple users login with same/diffrent credentials in same browser
I got the answer for my question .... Here is the code for the redirecting user based on the session[user] in LoginViewController.php and it's working fine.. 1) Always place session_start() top of the code... <?php session_start(); include('GenericClasses/GenericCollectionClass.php'); include('Models/UsersModel.php'); include('DataObjects/Users.php'); include('DatabaseAccess/DBHandler.php'); if(!empty($_SESSION['user'])) { header("Location:loggedin.php"); die(); } else { ?> //Html code for login page <?php } ?> Here is Loggedin.php code .. <?php session_start

Categories : PHP

Multiple site domains and virtual directory single login
What you are describing is a 'classic' SSO (single sign-on) example. There are lots of ways people have tried this and they are well documented on Google. One way to do this is to have your SSO server (e.g. the first place you land and log in) to issue a security 'token' (e.g. a Guid) and then either store this in a cookie or append to URLs. Each subsequent call to an application can look-up the token in a database, verify it's validity and carry on (or boot the user out if invalid). Using a database also allows you to set a timeout for all applications for which the token is valid. This can then be extended to allow the database to store which apps each user can access etc. I've described this in very broad terms but it may be a good starting point. Hope this helps BTW: querying the

Categories : Asp Net

making my site show mysite.com/login/ instead of mysite/login.php?action=login&var=1234
Put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / # specific rule to handle these URLs RewriteRule ^login/?$ /login.php [L,NC] RewriteRule ^index/?$ /index.php [L,NC] # OR a generic once to forward all /foo to /foo.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/$1.php -f RewriteRule ^(.+?)/?$ /$1.php [L]

Categories : Apache

Build Curl on vc9/vc11 with release dynamic library with dynamic ssl, ssh2 and dynamic zlib
The answer is: you can't What you should do is build curl with ssl, ssh2 and zlib internally using CFG=release-ssl-ssh2-zlib. Then use this patch to add the dlls to the link command. Note this patch is for VC10, but can easily be done on the vc9 makefile. After the builds, you will need to add libssh2.lib in to lincurl.lib, if you want to build something against it (say PHP). That can be done with this command (set the paths to the your libssh2.lib and libcurl.lib): lib.exe /OUT:libcurl_merged.lib libssh2.lib libcurl.lib copy libcurl_merged.lib libcurl.lib

Categories : Windows

modrewrite help using multiple dynamic gets
I solved it! RewriteEngine On RewriteBase / #This rewrite has no L flag so the second one can continue #Signin.php can have multiple networks like signin/twitter = signin.php?network=twitter RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^signin/([^/]*)$ /signin.php?network=$1 [QSA] #this rewrite just allows to use files withouth the .php # Like about instead of about.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.+)$ /$1.php [QSA]

Categories : PHP

using multiple dynamic jquery
You need to use event delegation - $('#Mondaydiv').on('change','#monbus1',function() { $('#montype1').toggle(); }); To bind change event on all of your monbus input - $('#Mondaydiv').on('change','[id^=monbus]',function() { var count = this.id.replace('monbus',''); $('#montype'+count).toggle(); });

Categories : Jquery

Dynamic multiple domains in one project
One of possible solutions: Client's domain - hosted on your server. Each client's domain is linked to directory - where your php application is placed. Your application shows content depending on $_SERVER["HTTP_HOST"] value - which returns domain of your application (this would be in your case http://www.myclientdomain.com)

Categories : PHP

Displaying multiple dynamic posts using asp.net
Using web forms, that would be easiest to solve using a Repeater control. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.repeater.aspx

Categories : Asp Net



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.