w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Enable / disable cookie based login in Yii framework on login
You would use this if user checked the remember me checkbox: Yii::app()->user->login($identity, 24*3600*7); and this if he didn't: Yii::app()->user->login($identity, 0); Make sure that you allowed auto login in your config file: 'components' => array( 'user' => array( 'allowAutoLogin'=>true, ), // ... ),

Categories : PHP

Login as root with trying different passwords in php
$passwords = array('pass1', 'pass2', 'pass3'); if (!$ssh->login('ntsysadm', 'ABCD123')) { echo "Login failed."; return; } //No need to use else foreach($pass in $passwords) { $ssh->write("su root "); $ssh->write(sprintf("%s ", $pass); if(strstr($ssh->HowIsThisFunctionCalled, 'Logged in')) echo sprintf('Password %s is correct.', $pass); else echo sprintf('Password %s is not correct.', $pass); } Replace 'HowIsThisFunctionCalled' with the function, that reads out the whole terminal text or last message, pretty sure this exists in PHPSECLIB.

Categories : PHP

Remote login as root in ubuntu
Ubuntu documentation says: By default, the Root account password is locked in Ubuntu. It also says: Please keep in mind, a substantial number of Ubuntu users are new to Linux. There is a learning curve associated with any OS and many new users try to take shortcuts by enabling the root account, logging in as root, and changing ownership of system files. It talks at length about why it's been done this way. Enabling the root account: sudo -i To enable the Root account (i.e. set a password) use: sudo passwd root Use at your own risk! Logging in to X as root may cause very serious trouble. If you believe you need a root account to perform a certain action, please consult the official support channels first, to make sure there is not a better alternative.

Categories : Linux

Granting privileges to root won't let me login?
Looks like you may need to get a bit clever. If you can download a zip of the version of mysql you have installed and unzip it somewhere not in you actual installed mysql location. You can then rename the existing /data/mysql folder and copy the vanilla /data/mysql directory over your now messed up one. This should reset you to its initial state. You will of course have to re-create all the other mysql accounts ( if you created any ). And this time I would create a new account for your remote access, and if necessary give that all privilages.

Categories : Mysql

Rails 3: How to set the Devise login like root
I have the following code in my routes file. I'm adding users under devise_for and rooting to the page I want users to go after login devise_for :users root :to => 'account#index' resources :devise

Categories : Ruby On Rails

DIsable native app for facebook login (just use pop up)
Have you put into your Facebook App Settings on Facebook.com the name of the activity that the native facebook app is meant to go to once authentication has completed? It's possible that it is missing or there is a mistake and results in the native facebook app calling a non-existent activity once the sign on is complete.

Categories : Android

How to disable the login on local installation of wordpress
You could add some javascript to auto enter the form and submit $("#user_login").val("actualusername") $("#user_pass").val("actualpassword"); $("#login_form").submit(); That's the easiest way i can think of.

Categories : PHP

Bug in Game Center login Disable feature
Solved I solved this at manual with using NSUserDefaults and with saving a count of Game Center view showing and with erasing count to 0, if user is Log In to Game Center at successful. After 3 pushes to Cancel button, a just is not showing a Game Center view at manual.

Categories : IOS

Disable Push Notification after New Installation of app without login
I like this situation...Check my logic. Fist important thing you have is that when the app uninstalled,its database also gets vanished. this is the trick. ==>You have to maintain a reference number which start from 1. (you may put it hard coded and only have to update) use this reference number each time with your - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //get value from database,increment by 1 //sync with server } each time app gets started you have to increment the reference number also. need to keep track of this reference number on server side also. Second scenario(i.e. problem you facing) is when app gets reinstalled: all database gets vanished automatically.==>this is the trick when you use reference numbe

Categories : IOS

How to login in sqlserver when all user disable in sqlserver?
Problem statement. All logins that are members of the sysadmin fixed server role have been removed by mistake. All Windows Groups that are members of the sysadmin fixed server role have been removed by mistake. The logins that are members of the sysadmin fixed server role are for individuals who have left the company or who are not available. The sa account is disabled or no one knows the password. for step by step solution see below link http://technet.microsoft.com/en-us/library/dd207004.aspx

Categories : Sql Server

Linux skip /root/.gvfs when executing df command with non-root user
I got the solution for my own question :) In df command you can pass the file system types which you would like to exclude, in this case it is 'fuse.gvfs-fuse-daemon'. So when I execute the below the command I no more get this message "df: `/root/.gvfs': Permission denied" df -x fuse.gvfs-fuse-daemon For more details one can look into df --help option.

Categories : Linux

Is sudo-ing tomcat's startup with a non-root user the same as running it as root?
Do be aware that the recommended solution to run tomcat on port 80 is to use mod-jk with the Apache web server, not to have tomcat listen on port 80 directly.

Categories : Unix

Root immediate child nodes icons not visible when hiding root
JTree#setShowsRootHandles(boolean newValue) controls the state of the handles for root elements. Normally, this is false. Try changing to true

Categories : Java

Reset MAMP Pro username and password to root/root
Assuming you still know the password, you can change the password back to root using /Applications/MAMP/Library/bin/mysqladmin -u root -p password root It'll prompt you to enter a password again, after which it'll be reset to root

Categories : Mysql

Read and Write root folder wihout root
You can use run-as on some devices to execute commands as a particular package. Google have fixed this on Jelly Bean so it no longer works: adb shell run-as app.package.name cp /data/data/package.name/file.txt /sdcard/ exit adb pull /sdcard/file.txt ~/ Here is a good article explaining file access in Android without root permissions, including a one-liner for the above script. It details how to use the new backup command: backup -f ~/data.ab -noapk app.package.name And how to extract the contents of the resulting .ab file: dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar -xvf - You will most likely need the android.permission.BACKUP permission.

Categories : Android

SVN (svnserve) virtual root --root= not recognized
svn+ssh handles the whole transaction including writing and reading the files so it ignores the --root parameter in svnserve. Here is how to fix it over at serverfault -- Basically you just make svnserve into a script that calls svnserve with the proper variables.

Categories : Svn

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

Document root element "hibernate-configuration", must match DOCTYPE root "hibernate-mapping"
DOCTYPE for <hibernate-configuration> should be: <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

Categories : Hibernate

is there any method to draw a tree with a root , the root's previous nodes and successor nodes?
Couple of ideas you might find useful: You can use the tree layout to place the nodes in the canvas, create link objects pointing back and forth, then bind the link objects to a diagonal. http://www.durablejs.org/examples/flowchart/1/admin.html You can also use place the nodes using a pack layout, create the link objects pointing back and forth, and bind the links to a Bezier curve. http://www.durablejs.org/examples/statechart/1/admin.html You can find the code for the graphs above: https://github.com/jruizgit/durable/tree/master/lib/durabjevisual.js

Categories : D3 Js

How can I remove the root node and make the first child the new root node with XSLT?
Add a rule to the identity transform that adds nothing to the result tree for your document element other than the processing of its children: <?xml version="1.0" encoding="US-ASCII"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/*"> <xsl:apply-templates select="*[1]"/> </xsl:template> <xsl:template match="@*|node()"><!--identity for all other nodes--> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> (edited to be agnostic to the name of the document element) (edited again to only preserve the first child element of the document element)

Categories : Xml

Including from child theme root or else include from parent theme root
To answer your question directly based on your sample, i would not check to see if the file has been placed in the child theme. If a child-theme developer has customized the file, they can simply declare the function and include their own file (wherever they place it). There is no risk of code duplication because your sample function is simple enough. Even if you simplified your code for the purposes of placing it here....you can always keep includes wrapped in a very simple function that can be declared by a child theme. This will keep PHP running efficient and not having to check for files all the time.

Categories : Wordpress

Disable autochange scrollbar position (disable scroll to active control)
Find the same question here How can I disable the scroll-into-view behavior of TScrollBox? In my case I use override AutoScrollInView procedure. Disable implemention of this procedure at all. procedure TfrSection.AutoScrollInView(AControl: TControl); begin // inherited; end; It works.

Categories : Delphi

Defining root of HTML in a folder within the site root folder
You need to set the base tag. If you add the tag in your page <head> like this: <base href="http://yoursite.tld/folder/"> it should display images and with sources relative to this base path.

Categories : HTML

I want to set authenticated users' root to a nested resource, their dashboard, instead of the home#index page non-authenticated users use as root
Option 1: In your dashboards controller, change to: @user = current_user @dashboard = current_user.dashboard This will also prevent users from seeing other user's dashboards. Option 2: Now, if users can see other user's dashboard fine, then change your route: root :to => "dashboards#find", as: :authenticated_root and in your dashboards controller: def find redirect_to user_dashboard_path(current_user, current_user.dashboard) end

Categories : Ruby On Rails

Login failed for user 'DomainUserID'. Reason: Could not find a login matching the name provided
Did you add that windows login in SQL Server? CREATE LOGIN [<domainName><login_name>] FROM WINDOWS; GO Update: If you do not know the sa password and your windows login does not work. You will have to do one of the following: Unistall and reinstall Put the instance in single user mode (only works if you are an admin on the SQL Server machine), http://msdn.microsoft.com/en-us/library/dd207004.aspx

Categories : Sql Server

Convert a 'login.php' page with form and error checking into a dropdown login instead
You just have to create the form inside the dropdown, and send the input to login.php. Something like: <form method="post" action="login.php"> <input type="text" name="username" /> <input type="password" name="password" /> <input type="submit" value="Login" /> </form> When a user submits the form, the data is sent to login.php, that will perform validation and will then redirect the user to the corresponding page. So just copy the form.

Categories : HTML

Java HtmlUnit login with user and password returns to login page
Looks like your code is ok. I have tried it manually and sometimes it loggins and sometimes not. The problem is in the pop-up window which appears after login operation. You can saw it from the javascript on the page: if ($("#ErrorDuplicationLogin").text() != '') { $(".PopUpContent").show(); $(".pagePopBackground").show(); } }); So try to login and logout manually and after that launch your program. Also do not forget to logout using HtmlUnit. Thank you.

Categories : Java

custom facebook login button leaves blank login popup
ok, sorry. I was looking deep into facebook apis when the problem was that in my button's onclick I forgot to return false, so the button click reloaded the page and that broke stuff I guess by invalidating various facebook api internal references. Just changing onclick function to return false fixed my problem. see code for new line: $("#linkfacebook").click(function() { FB.login(function(response) {}, {scope: 'publish_stream,manage_pages'}); return false; // this is the new line that fixed the problem });

Categories : Facebook

Handling failed login notifications with Spring Security 3 login handlers
An alternative way to recieve notifications about authentication events is to listen for ApplicationEvents broadcasted by Spring Security, namely, AuthenticationSuccessEvent and AbstractAuthenticationFailureEvent.

Categories : Spring

MVC4 WebSecurity.Login fails first time through, can't get User in Login method
As the post you found pointed out the user identity is not set immediately after login, so User.Identity.Name does not contain the user name. Use model.UserName instead. Try changing this line: if (!IsProfileComplete(WebSecurity.GetUserId(User.Identity.Name))) To this: if (!IsProfileComplete(WebSecurity.GetUserId(model.UserName)))

Categories : C#

Creating sessions for my login page and counting number of unsuccessful login
First of all you need a session variable to store in login attempts. So the first line of your doGet() must be something like this: // Do not create session if it doesn't exist HttpSession session = request.getSession(false); int loginAttempts=0; try{ loginAttempts = Integer.parseInt(session.getAttribute("LOGIN_ATTEMPTS").toString()); loginAttempts++; //if code comes here then the user has already made a login attempt and therefore icrease the counter }catch(Exception ex){ //if error then that means that the user has never made a login attempt because the attribute was not found session.setAttribute("LOGIN_ATTEMPTS",1); } Then after you validate the user credentials you should see if the login attempts counter is equals to a number and forward the request appropriately to the vi

Categories : Java

Django- why inbuilt auth login function not passing info about user to after successful login url
Once the user is redirected to accounts/profile/ the view for that link will be returned. You can access information about the currently logged in user there as per this post by using request.user. Also tip to see what information you have access to in your views. Use import pbd; pdb.set_trace(). This pops you into a python prompt with access to all of the current variables. To see all the defined variables call locals(), though this will print out a ton of junk along with it. In the template you can display a "you can't access this page" message if the user isn't logged in.

Categories : Python

Trouble Connecting to sql server Login failed. "The login is from an untrusted domain and cannot be used with Windows authentication"
Why not use a SQL Server account and pass both the user name and password? Here is the reason why. In short, it looks like you have an authentication issue. The problem with workgroups is there is no common Access Control List like Active Directory (AD). If you are using ODBC or JDBC, the wrong credentials are passed. Even if you create a local windows account (LWA) on the machine (SE) that has SQL Express installed (SELWA), the credentials that will be passed from your client machine (CM) will be CMLWA.

Categories : Sql Server

If I cancel Login Dialog, login error occurs: Unauthorized Access is denied due to invalid credentials
HTTP code 401 means "unauthorized". When the browser receives this error code, it assumes it's because the user needs to login. The browser displays a login dialog, and then tries again with the login details given. This is exactly what's supposed to happen. If what you're wanting is to simply refuse the request, you're after HTTP code 403, "forbidden". However, I'm not clear on why you're actually trying to achieve here. If your own server code is returning an HTTP 302 (a redirect), why are you trying to convert that to an HTTP 401/403/whatever? If you don't want to perform redirects for some reason, don't issue the redirect in the first place!

Categories : C#

Login Process , OAuth (facebook,twitter) and also "Normal Way" login
For Facebook: You can use PHP API and thy to get user. Get user $facebook = new Facebook($config); // Get the Facebook class try{ $facebookId = $facebook->getUser(); } catch(Exception $e) { $facebookId = false; } if (!$facebookId) { /** * Redirect to authorization */ $redirect = 'THIS_URL'; // FB will redirect here after auth. $scope = 'publish_stream, email'; // Redirect user to URL provided by Facebook class return $this->redirect($facebook->getLoginUrl(array('redirect_uri' => $redirect, 'scope' => $scope))); } // Here you can find that user by $facebookId and authorize him or register him.

Categories : PHP

Django - Extend the login function to save the last but one login datetime
There are login and logout signals sent by Django that You can use for this purpose: https://docs.djangoproject.com/en/1.5/ref/contrib/auth/#module-django.contrib.auth.signals

Categories : Python

php: make a difference between reload login form or duplicate login
I'm trying to, at the same time, prevent users from reposting the login form, meaning, I want them to avoid clicking on reload right after they login. To prevent this, you should follow the POST-Redirect-GET pattern and ALWAYS redirect after a successful POST. i.e. If the login is successful, redirect them to a splash page or a home page etc. Secondly, if the user is logged in and browsing via another tab, he or she will have the same session ID as the first tab. This is unless they've opened a new private browsing / incognito window or they're utilizing a proxy.

Categories : PHP

how to keep the user login for all pages in wordpress custom login function?
You can use the wp signon function: Function Reference/wp signon as you can see here: <?php wp_signon( $credentials, $secure_cookie ) ?> it gets and array ($credentials) and a boolean (which is optional). here you can see a sample code it's use: $creds = array(); $creds['user_login'] = 'username'; $creds['user_password'] = 'password'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message(); this function is a core wp function, means that which means that when it's used, it will do everything the wordpress need it to do for it to work as it should. next, you need to use WordPress Cookies. in your case i have seen you used: Function Reference/wp set auth cookie which is taking these parameters: <?ph

Categories : Wordpress

jQuery login button is opening a login window, but if javascript is off
Put the actual link in the href="" and add onclick="return false;" to the a tag. Ie: <li id="last-child"><a href="/login.php" onclick="return false;"><div id="login"></div></a></li> The "return false" tells the browser not to follow the link if JavaScript is enabled. If JavaScript isn't enabled, the "onclick" event won't fire and the "return false" has no effect.

Categories : Jquery

how do I detect if user logged in using my login button or login from facebook?
Just add a parameter to the links you're using for login buttons. For example http://www.example.com/index.php?login=facebook http://www.example.com/index.php?login=custom

Categories : Javascript



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