w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

How to enable the root element in tree view
Solving the problem for last comment: please suggest me instead of using $("#treeview").find(":checkbox").attr("checked", true); any other function that enable all the checked item default in all browsers Add change event and change whatever you want in each function. $("#treeview .k-item input[type=checkbox]:checked").closest(".k-item").each(function(){ // change whatever you want, for example: $(this).css("color","green"); }); This is similar to what you're using, but I've checked it in Chrome, Firefox and IE and works fine. See this Fiddle (adapted from KendoUI demos).

Categories : Kendo Ui

How to enable 2 logged in users to my app?
You can store the company id in the url, so in the one tab you have /edit/company/1 and in the ohter /edit/company/2 Then you can let them choose either one of the companies, and make sure that id is at every url. Make sure that the correct permissions are set though, if you maintain a lot of users/companies.

Categories : PHP

Enable GRANT options for users
GRANT SELECT, INSERT ON *.* TO 'someuser'@'somehost'; means , You are giving select and insert permission to the user 'someuser' from 'somehost' machine on .(means all tables in all databases). Please be mind to flush the privileges.

Categories : Mysql

Trying to build a GUI that would enable users to add more TextFields to it
I will give you an idea : you can add button and inside the button instruction you would add an instruction set that create text field . if you want more than once then you must handle position pointer that tell you the last place the user add text field then by updating the pointer the user can see the text in different place , if you want the user to control the position of the text then he must enter the location .

Categories : Java

Possible to have multiple git users logged in as root?
It would be safer to manage that kind of access control with an authorization layer like gitolite, instead of relying on system account. That way, you are controlling who can pull what. Although that wouldn't control the "where" part (where the users would pull those repos to)

Categories : Linux

How to enable phone bluetooth programmatically, without the users permission?
Yes this is possible. btAdapter = BluetoothAdapter.getDefaultAdapter(); if (btAdapter == null) { // Device does not support Bluetooth Toast.makeText(getApplicationContext(), "Device does not support bluetooth", Toast.LENGTH_LONG).show(); } else { if (!btAdapter.isEnabled()) { btAdapter.enable(); Toast.makeText(getApplicationContext(), "Bluetooth switched ON", Toast.LENGTH_LONG).show(); }

Categories : Android

Enable access to module for unauthorized users in Yii's srbac
I've added hybridauth@DefaultIndex and hybridauth@DefaultCallback to allways allowed list and now it works. The construction of this string can be seen in srbac/Controllers/SBaseController.php in function beforeAction: $access = $mod . $controller . ucfirst($this->action->id);

Categories : PHP

How would I enable users to download an excel file which is created on the server
try below where you will make a call to FileDownload servlet once user click on download link public class FileDownload extends HttpServlet { public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { String filename = "E:\workbook.xls"; ServletOutputStream out = response.getOutputStream(); FileInputStream in = new FileInputStream(filename); response.setContentType("application/vnd.ms-excel"); response.addHeader("content-disposition", "attachment; filename=" + filename); int octet; while((octet = in.read()) != -1) out.write(octet); in.close(); out.close(); } }

Categories : Java

Issues with some users in Win Authentication in ASP.NET
Trogvara, Thank you for your posting , I'm new to the site and tried to formatted but it did what we see now, the Web config setting is : <authentication mode="Windows"/> <authorization> <deny users="?"/> <authorization/> <identity impersonate="false"/> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> </system.webServer> Hope that clears the setting in Web.config Thank you,

Categories : Asp Net

Why are users disabled in the Build Permissions list and how can I enable them for distribution of my TestFlight app?
Your provisioning profile has a list of devices associated with it. TestFlight grays out team members who don't have a device that's part of that list. This means, in the iOS Dev Center, you need to update your provisioning profile's list of devices (just check that entry) or even add the device to your dev account's master device list if needed. Also, super-imposing a provisioning profile via TestFlight has never worked for me to update the original device list in the profile.

Categories : Misc

Unlimited users Wifi AP android mode (no ROOT privileges)
The Android limit is hardcoded at a system level, and probably at a protocol level too. Modifying it will at the very least require root privileges, and maybe even a direct rewrite of the Android code at the system level.

Categories : Java

Manage users authentication with angularjs
I am currently learning angular JS. I cooked this up one day: app.factory("user", function($http, $q) { var user = {}; // query logged in status on initial page load $http.get("/loggedin").success(function() { user.isLogged = true; }).error(function() { user.isLogged = false; }); user.login = function(username, password) { var defer = $q.defer(); if(user.isLogged) { defer.resolve("Already logged in"); return defer.promise; } $http.post("/login", {username: username, password: password}) .success(function() { user.isLogged = true; defer.resolve("User login success"); }) .error(function() { defer.reject("User login failed"); }) return defer.promise; } user.logout = function() {

Categories : Javascript

Sharepoint 2012 Authentication for non-AD users
Here is a solution I found quite some time ago.. In Internet Explorer, click on Tools and select Manage add-ons Highlight Toolbars and Extensions in left navigation. Locate SharePoint OpenDocuments Class Right-click and click the Disable button Close and refresh browser

Categories : Authentication

asp.net authentication of users best methods webforms
As you have posted the code may be you would get some good answer. I would try to answer as per my understanding, hope that helps. I have been out of touch of VB for long time so bare with me if it does not make sense. From where do you invoke CustomIdentity? In the first method in the Else part I think you might want to use Not IsAuthenticated if you want the user to redirect to the login page. Most of the times if the ticket is invalid you don't even have to do it the framework does it for you. In the CustomIdentityUser you have a private member _Auth which you never use while returning some values through the properties. You are using Auth.UserName instead of _Auth.UserName, I am not sure how that works unless the UserName is static member. Why is you custom Identity dependent on Auth

Categories : Asp Net

Rails: How to enable users to create a record but requires admin approval before posting
You can allow all users to create projects, but allow only admins to approve them. And on projects index page you can list only approved projects. class Ability include CanCan::Ability def initialize(user) can :create, Project if user && user.admin? can :approve, Project end end end Projects controller: def index @projects = Project.where(approved: true) end def approve if can? :approve, Project @project.update_attributes approved: true end end I assume that new projects are created with approved: false.

Categories : Ruby On Rails

Kohana authentication module not loging in users
First of all make sure your user has login role assigned in roles_users table. By default you won't be able to login if you don't have this role. Btw. it's cleaner to write: $post = $this->request->post(); $user = Auth::instance()->login($post['email'], $post['password'], isset($post, 'remember'));

Categories : PHP

Windows Authentication - How to Deny Users using Code
If you want to authenticate by using information from a database, you would have to use forms authentication. The steps you have to take are: Build a Login-Webpage (login.aspx in this example) Put this in your web.config, to specify the login page and deny access for all users initially: Code: <authentication mode="Forms"> <!-- Login.aspx is the login page forms authentication should use. --> <forms loginUrl="Login.aspx" name=".ASPXFORMSAUTH" timeout="30" slidingExpiration="true" > </forms> </authentication> <authorization> <!-- deny all users access to ressources of this app, if not logged in. --> <deny users="?" /> </authorization> In your login page, in code behind, call this to let a user pass: Code: FormsAuthen

Categories : C#

How to make gradle generate a valid pom.xml file at the root of a project for maven users?
You can use the gradle maven plugin. This adds the pom convention method to your project, which you can use in a task to generate a pom.xml file, like apply plugin: 'maven' task createPom << { pom { project { groupId 'org.example' artifactId 'test' version '1.0.0' inceptionYear '2008' licenses { license { name 'The Apache Software License, Version 2.0' url 'http://www.apache.org/licenses/LICENSE-2.0.txt' distribution 'repo' } } } }.writeTo("pom.xml") } Then you call gradle createPom to generate the pom.xml in the project root. Of all the things in the pom definition, you should really provide

Categories : Java

Authentication & Roles management for different users, howto solve this?
can can + devise is a great way to solve problems like this one, also i would suggest only one model for the user and a usertype attribute that defines if its a student or a user, for the connections you can create a user controller and a student controller if you only need to show them to specific users and you can use cancan to authorize that like this: class Ability include CanCan::Ability def initialize(user) if user.usertype=1 can :read, Student elsif user.usertype=2 can read, User end end end your student role can be the usertype = 1 or something if you need more help ask me.

Categories : Ruby On Rails

php Get users instagram photos and videos using Oauth without user authentication?
You can get it using the User's ID with the user media recent endpoint. This endpoint will return media for the user with ID 1234: https://api.instagram.com/v1/users/1234/media/recent

Categories : PHP

For a Ruby CLI, what is the most reliable way to change directory to users root/home directory?
To summarize Avdi Grimm's screencast on the same subject, If you're using a Ruby version greater than 1.9, the Dir module provides a method #home. However, this depends on the environment variable HOME set on the user's shell session. To reliably get the home dir, you should pass in the login name of the current user to the Dir.home command. Or, in code: # Works if HOME is set in the environment i.e., if "echo $HOME" returns the home directory # when that command is run on the command-line Dir.home # => /Users/<username>, Works if HOME is set # If the HOME environment variable is not set, you should explicitly pass in the username # of the currently logged-in user Dir.home(username) # => /Users/<username> # The current username can be obtained using username

Categories : Ruby

Spring Security - Users redirect based on business logic post successful authentication for all secure pages/views
I would look at this as a cross cutting concern, so in my opinion you're right to be considering the filtering approach. I don't think implementing a custom AuthenticationSuccessHandler is the right way to do it. By using a filter, you will gain control over which URLs the logic applies too, not only when the user authenticates. As to how you achieve the filtering, there are a couple of ways to configure it, but I can't see you needing to do anything more complicated than provide a well tested javax.servlet.Filter implementation. Option 1 would be to configure your Servlet Filter as part of the Spring Security filter chain. Spring Security is implemented as a series of Filters, each with a clearly defined role. Spring Security allows you to insert custom filters into this chain for appl

Categories : Spring

How will “windows based” authentication work in MVC web application, if users access the application from outside the company intranet
Assuming your website in IIS is visible to the outside through the firewall, then yes it will be accessible from home depending on the browser, you should get a pop up asking for username and password, and the username should be typed MYDOMAINJOEBLOGGS This setup may well work fine but it depends on your needs - is your network admin happy to open this server up to the outside world There can be a quirk if using Internet explorer externally, where IE does not display a pop up box, and instead tries to authenticate with the local windows username, which may not match AD username if it is a personal PC (to get around this on the client, go to Internet Options > Security > Custom Level then scroll down to User Authentication and select 'Prompt for username and password'

Categories : Asp Net Mvc

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

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

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

how do you enable php to enable to make http calls
The thing is that fsockopen is used for opening socks (i.e connect to the specified port on the specified host/IP). When you try to open sock to the host "http://google.com" it is like running "ping http://google.com" - you will get an error - as there is no such host "http://" What you shout do is use http_get or curl <?php $response = http_get("http://www.example.com/", array("timeout"=>1), $info); print_r($info); ?> or remove the "http://" <?php $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br /> "; } else { $out = "GET / HTTP/1.1 "; $out .= "Host: www.example.com "; $out .= "Connection: Close "; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($

Categories : PHP

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

How can we use app engine users API (java) with other google APIs to get users' profile pictures?
To get a user's profile picture from Google+ you need to use G+ API which requires using OAuth2. Here is a very simple example how you can get a person's profile info (including profile picture) : https://developers.google.com/+/api/latest/people/get?hl=en#examples Hope this will help you :)

Categories : Google App Engine

Login system using physical postgres users not "logical" users
To achieve your goal all inserts, updates and deletes, need to leave a trail that is difficult, if not impossible for a standard user to change. you can create: 1) Two schemas: one for common tables, one for security stuff like login/pass(hash) table, user session log, change log table, etc. 2) Two users: one common user, that can only use dml on common schema (no ddl), one superuser. 3) Login function that will check provided user/pass against login/pass table and log successful/failed attempts into user session log (you need SECURITY DEFINER function) 4) Set of audit triggers on common schema tables that will check the user privileges and log any changes, made by the user (SECURITY DEFINER functions here too).

Categories : Security

How can I authenticate users on Ignite Openfire against my MongoDB instance that contains users?
I am pretty sure you will have to create your own AuthProvider since the built in DB provider is JDBC based (which I assume doesn't work with MongoDB, but that is an assumption). I haven't done it, but I would guess it isn't that hard to do. The interface is fairly simple.

Categories : Mongodb

How to sort posts based on users interactions/most interested users
I deal with exactly the same problem and the approach is same as explained by @relentless Find all the associations of the current user Sort by number of likes However this looks very good in theory, but in practice in my case it required more time than the user was willing to wait. So what I did is that I limited the number of the database records (posts and events in your case) to some amount that can be processed in like 2 second time-frame. In my case this was 6 months in the past, but in your case you have to tune the timing and the load to best suit your needs.

Categories : PHP

MVC4 Forms Authentication but Windows Authentication in Admin Area
Supporting both forms of authentication for one site is a little dicey. I would suggest setting up two separate sites, one for admin and one for the members that both point to the same database. Check out this discussion about the topic: Mixing Forms authentication with Windows authentication

Categories : Asp Net Mvc

JBoss 7.1 Database based JAAS authentication - authentication failed
It worked after I commented out the below statements which was appearing as default in standalone.xml. <security-domain name="other" cache-type="default"> <login-module code="Remoting" flag="optional"> <module-option name="password-stacking" value="useFirstPass"/> </login-module> <login-module code="RealmDirect" flag="required"> <module-option name="password-stacking" value="useFirstPass"/> </login-module>

Categories : Java

authentication failure for "/": Password Mismatch in apache radius authentication
I have not dug very deeply into this, but I have observed the Password Mismatch error (it's actually error # AH01617 ) when the method of encoding a password does not match how the password is encoded on the end authenticating system. In your case, Apache will solicit, using AuthType Basic, a password in plain text with Basic Authentication. I was not able to locate documentation on the AddRadiusAuth directive that you use, but if you specify that the idea encryption algorithm is used on your Radius authenticating server, then this definitely does not match how the passwords were originally solicited to be sent (Basic Auth). I will not put money on this since I can't find documentation for AddRadiusAuth, but it looks like you can also specify sharedsecret other than idea according to

Categories : Authentication

SSHAuthenticationExcetion :No suitable authentication method found to complete authentication
Normally No suitable authentication method found to complete authentication is used is returned from an SSH server when the server does not allow authentication by the offered methods by the client. The SSH server could only allow public key authentication, or some form of two factor authentication in turn preventing password authentication. Download an SSH client like Putty and try to connect to the server directly and see what the result is.

Categories : Vb.Net

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



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