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

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

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

populate a drop down menu with database users names, when a username is selected refresh showing users details
Use a form <form action="/yourpage" method="post"> <select> <option value="<?=$id; ?>"><?=$name; $></option> </select> <input type='submit'/> </form> In yourpage.php <?php if(isset($_POST)){ // load user data // or redirect with header() to preexisting page } // load view with user data ?>

Categories : PHP

Rails user_path routing to users/index instead of users/id
Have you checked if @user has a value? user_path(@user) will go to /users/<@user.id> but if @user is nil, it will try to go /users/. Given you haven't created the index method and views yet, that will probably be why it fails. Thanks for the test code. Firstly your user is not in the database - change the .new to .create or add a @user.save. Secondly your params[:id] is not populated in the test code so the find will fail (add controller.params[:id] = @user.id to your test). (Thirdly you have a typo shoult instead of should in the last test.)

Categories : Ruby On Rails

Why CSRF protect session-less users?
Off the top of my head: Having CSRF protection on day 1 means you don't need to worry about adding it after the fact if on day 17 you add user sessions Even if there's no explicit sessions, there still could be some other authentication or mechanism that is protecting the site (example would be if you were running a django site on your private network; if you were browsing from inside your network that site AND evil.com, evil.com could trick your browser into sending requests to your private site. Rather unlikely but at least makes the point I hope.) You might also want to raise this on the security stack overflow. (Updated based on comment below) Even if there was no authentication or other reason to trust the browser, there are two other weak benefits for using CSRF protection: As

Categories : Django

How do I remotely invalidate a users servlet session on-the-fly?
Call the session.invalidate(). You could get the session object from the request.getSession(). It will return the current http session, the same as request.getSession(false). session.invalidate() kills the current session permanently you need to call request.getSession(true) to proceed with the new session. To implement BAN user, or keep control of the user session you need to put the session object to the servlet context with the user name once the user has logged in. The user may have many sessions to ban it all you should invalidate all valid (active) sessions. You might also clean up user sessions once the user has logged out or banned.

Categories : Java

how to integrate wordpress users with vbulletin users
You can give a try to obscureclouddon's mod, as an alternative to vbSSO. (an other link here) It seems to be a good choice, since it has features you need : WordPress->vB features: *Registration sync – new users created on WP are automatically created on vB vBulletin ->Wordpress features NEW *Registration sync – new users created on vB are automatically created on WP The bad things are : this modification is in beta stage free version has limited features, the pro version is, IMHO, expensive... (but it could worth the cost..)

Categories : PHP

Should "/users" and "/users/" point to the same (RESTful) resource?
Technically they are not the same. But a request for /users will probably cause a redirect to /users/ which makes them semantically equal. In terms of JAX-RS @Path, they can both be used for the same path.

Categories : Http

Setup so users can follow(bookmark) other users
Think about it like Relationship is a join table between a many-to-many association (i.e. a user can follow many people and a user can be followed by many people). You shouldn't need Relationship routes. Remove resources :relationships, only: [:create, :destroy]. Also, make sure you've migrated in a Relationship table like: class CreateRelationships < ActiveRecord::Migration def self.up create_table :relationships do |t| t.integer "follower_id" t.integer "followed_id" end end def self.down drop_table :relationships end end and created a Relationship model like: class Relationship <ActiveRecord::Base belongs_to :follower, class_name: "User" belongs_to :followed, class_name: "User" end

Categories : Ruby On Rails

How to change session cookie domain for existing users
Set a new session_name() before you start the session. That way the name of the cookie changes, and any old cookie will be ignored. Only new cookies will be sent out and work for the session.

Categories : PHP

How should I handle users loging into multiple accounts in the same session?
As far as I noticed, google handles it by argument in url. The basic idea is that you store a table of user data in $_SESSION and not single record. Let's say you got kept in $_SESSION - username and userip after login procedure, so instead of keeping it directly in $_SESSION, you add a record to $_SESSION[] array. $_SESSION['username'] = ... $_SESSION['userip'] = ... to $_SESSION[] = array('username' => ...,'userip' => ...); Ok so after few logins we got an array of arrays of username and userip. The second thing is to rewrite url that it would ignore first part: /(.*)/(.*) -> /$2?user=$1 From now on, we refer to logged user session like this: $_SESSION[$_GET[user]][...] That would be it. Of course you may use different rewrite rules, it is just an idea example.

Categories : PHP

save data regarding unregistered users without using session or cookie
I'm not sure if I fully understand your question but it sounds like you want to keep track of how many times a certain person fills out a web form. I would grab their IP Address using this function: $ip = $_SERVER['REMOTE_ADDR']; Then, make a new entry in your SQL database for every submittal of the form. Each entry could have a row in SQL with the IP Address, Email, Name etc. You can then analyze SQL for whatever information you need. Does this answer your question?

Categories : PHP

Purpose of serializing/deserializing users into a session when using PassportJS?
It controls how the user instance gets saved to your session store (such as connect-redis). I'm no expert on JSP, but I imagine there's some sort of ISerializable interface that classes must implement, which would be a rough equivalent.

Categories : Node Js

Creating users with quickblox - session token generation
To generate QuickBlox token you should create session - make this query http://quickblox.com/developers/Authentication_and_Authorization#API_Session_Creation For this query you need signature - read here how to generate signature http://quickblox.com/developers/Authentication_and_Authorization#Signature_generation Also here is PHP example how to generate signature & obtain session token How to generate QuickBlox authentication signature in PHP? (last answer)

Categories : Javascript

Can't use users : Unknown database 'users'
you can try this in your phpmyadmin GRANT SELECT, INSERT, DELETE ON database TO username@'localhost' IDENTIFIED BY 'password'; then try to run your php code.

Categories : PHP

Facebook Php API: RSVP users to public event
$path = $event_id.'/attending?access_token='.$SOME_ACCESS_TOKEN; You're not using the access token in your code, so I am uncertain of whether you skipped it when you copied it, If it's not in the code, then it may be that. I retrieved the information here

Categories : Facebook

Is it possible to use windows users for database login?
DB2 always uses the host systems security for identification and authentication. So if you run db2 on a windows server anyone logging in will need a userid and password which is valid in the servers domain. If they are logged in on the domain already they should not need to log in again. And believe it or not Microsofts SQLServer also uses the standard Microsoft Windows domain user ids :-)

Categories : Windows

Get current logged in Windows Users privilliges
Below snippet is working for me in Windows7. Can you please try it out. Thanks public static bool IsAdminUser() { bool isAdmin = false; AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); WindowsPrincipal principal = (WindowsPrincipal)System.Threading.Thread.CurrentPrincipal; WindowsIdentity identity = (WindowsIdentity)principal.Identity; isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); return isAdmin; }

Categories : Windows

Is it possible to mklink a directory to different target for different users? (windows 7)
mklink cannot use environment variables, so the answer is "no, that's not possible". PS: I reviewed "subst", mountpoints and "net use", but none of them will suit your need. In fact, I'm unaware of any technique that will. Sorry :-(

Categories : Windows

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#

Windows Phone 8 - Sharing data between users
There are many options and there is no best option. It all depends on your specific requirements. In general, you will need a client app that runs on the phone and then some sort of online web service where both parties can talk to and that service can handle pushing communication between connected clients. However, for a chat application SignalR comes to mind. It provides real-time web functionality. I think there is even a WP chat sample application on their website.

Categories : Networking

Detect users logging off in Windows service
WM_QUERYENDSESSION is sent to all top level windows on the desktop in the closing session. However since your service usually runs in a different session, you normally won't get the notification. Before Vista you could enable interaction with desktop to share the desktop with the user on session 0, but you won't get the message sent to you if the logging off happens in another session. After XP, you won't get messages from user sessions due to session 0 isolation. To notify your service of this message, you need to run an agent process in each session (that is, register to auto start when the user log in via start menu shortcut or registry) and listen to WM_QUERYENDSESSION (in .Net terms, run a message pump like Application.Run in Windows Forms and subscribe to SystemEvents.SessionEnding

Categories : C#

Is it possible using AZMS to authenticate users against Windows Azure AD?
Looks like a very good solution to this question is to implement Auth0: Authenticate AZMS Apps with Auth0

Categories : Azure

Getting deleted users by lastknownparent in windows active directory using c#
Maybe I'm a little bit late but I hope this answer will help. Just replace ADEL with \0ADEL in your LDAP query. By the way, this rule applies to every attribute with dn syntax.

Categories : C#

Authenticate user from Perl against Windows local users
Ok, so I found a way to accomplish this. I'd still like to hear from you guys to see if there's a better method. Active State Perl includes a module called Win32::UserAuthentication, which is not documented (and is not on CPAN) and contains a warning about it not being maintained. However, it works over XS and returns a boolean when authenticating a local user. So far it works pretty well and fast for that part. For the checking of groups the user belongs to, I'm using this system command: net user $user | grep Administrators Which works pretty fast too and so far works for this purpose. NOTE: For anyone trying the command above, I only have grep because it's on my system path thanks to having Cygwin installed. If a better solution if proposed, I'll select it as best answer. Thank

Categories : Windows

Installing Apache on Windows for manual use and multiple users
you can get this in tomcat installation folder tomcat-users.xml. In tomcat6 the said file name is available in tomcat/conf/tomcat-users.xml In this file you will get the following <role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="role1" password="tomcat" roles="role1"/> <role rolename="manager-gui"/> <user username="tomcat" password="tomcat" roles="manager-gui"/> Edit the username and password for the role you want to give to your wife. If required restart the tomcat. EDIT By default this is commented, you have to remove the comment it

Categories : Apache

How to commit the multiple transactions from different users using concurrency in windows 8?
You have a database server accepting connections from various clients, and you want to synchronize them so that they are all treated as one big database transaction. I don't think this can be done in a straightforward fashion. You need your clients to save their data to an intermediary place (say, an "about-to-be-saved" table), and then once in a while, depending on what you define as 'at once', move data from the intermediate table to the "really-saved" table. You could implement this transaition from about-to-be-saved to really-saved inside your database, so you don't need an additional server. Keep in mind, though, that giving multiple clients direct access to your database is almost never a good idea.

Categories : C#

SqlServer mixed mode restrict windows users
Users have to be explicitly given permission to the server and database. Simply, by not granting access, Windows users do not have access. You can explicitly restrict access with: DENY CONNECT SQL TO [domainuser]

Categories : Sql Server

how to Diogenes users that login with remote desktop in windows xp by programming with c#
[DllImport("wtsapi32.dll")] static extern IntPtr WTSOpenServer([MarshalAs(UnmanagedType.LPStr)] String pServerName); [DllImport("wtsapi32.dll")] static extern void WTSCloseServer(IntPtr hServer); [DllImport("wtsapi32.dll")] static extern Int32 WTSEnumerateSessions( IntPtr hServer, [MarshalAs(UnmanagedType.U4)] Int32 Reserved, [MarshalAs(UnmanagedType.U4)] Int32 Version, ref IntPtr ppSessionInfo, [MarshalAs(UnmanagedType.U4)] ref Int32 pCount); [DllImport("wtsapi32.dll")] static extern void WTSFreeMemory(IntPtr pMemory); [DllImport("Wtsapi32.dll")] static extern bool WTSQuerySessionInformation( System.IntPtr hServer, int sessionId, WTS_INFO_CLASS wtsInfoClass, out System.IntPtr ppBuffer, out uint pBytesReturned); [StructLayout(LayoutKind.Sequential)] private str

Categories : Windows

Use Windows Azure Active Directory to register new users for MVC 4 website
I don't believe it is the user that has to be registered first. It is the application that holds the permissions to read/write to WAAD. If the application is registered in WAAD, and contains the necessary write permissions, then the app and query WAAD and add new users to the directory.

Categories : Asp Net Mvc

scripting languages native to windows for remote users support
You can run a powershell script like so: powershell -executionpolicy unrestricted -file "C:Myscript.ps1" This will not change the global executionpolicy for the whole machine, but just to run that script.

Categories : Windows

Trying to Creating users in Google Apps domain in Windows Forms code
I managed to solve this, primarily by modyfin code from the google-api-samples/Tasks.WinForms.NoteMgr; Here's how I've done it: public static DirectoryService Service { get; private set; } private static IAuthenticator CreateAuthenticator() { var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description); provider.ClientIdentifier = <myClientId>; provider.ClientSecret = <myClientSecret>"; return new OAuth2Authenticator<NativeApplicationClient>(provider, GetAuthentication); } private static IAuthorizationState GetAuthentication(NativeApplicationClient client) { // You should use a more secure way of storing the key here as // .NET applications can be disassembled using a reflection

Categories : C#

Allowing users to view parts of webpage based on their Windows domain login
Simon, You tag the question with asp.net-mvc, so I will give a quick example based on that. In your controller you can decorate either the entire controller, or just the action with the Authorize attribute. This means that you can explicity allow only users within certain Roles to have access to the function. By way of a quick example: [Authorize(Roles = "AdminRole, CreditAdvisorRole")] public ActionResult Edit() { var viewModel = _shopService.ShopIndex(); return View(viewModel); } So, that example would only allow users defined in the roles of "AdminRole" and "CreditAdvisorRole" to access the functionality. This of course is inbuilt behaviour and at some point, you will hit the limitations of this approach. At this point, then you can move on and create your own overrides o

Categories : C#

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 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

Windows Phone - How to detect what phone users have
According to the MSDN Documentation you need to be looking at the DeviceStatus Class in the Microsoft.Phone.Info Namespace. It will give you access to the: DeviceName DeviceManufacturer DeviceHardwareVersion DeviceFirmareCVersion to figure out the screen resolution you can look at this MSDN Library Article Sorry above was for DirectX Try looking at Windows.Graphics.Display Namespace's DisplayInformation Class to get your dpi.

Categories : C#

get list of logged on users on remote windows computer from a list computer
It (csv file) should be formatted as follows: computername server1 server2 server3 'Computername' is the column name. This can be derived from the code snippet as the Foreach-Object refers to the ComputerName property.

Categories : Windows

Event capturing jQuery
Use event capturing instead:- $("body").get(0).addEventListener("click", function(){}, true); Check the last argument to "addEventListener" by default it is false and is in event bubbling mode. If set to true will work as capturing event. For cross browser implementation. var bodyEle = $("body").get(0); if(bodyEle.addEventListener){ bodyEle.addEventListener("click", function(){}, true); }else if(bodyEle.attachEvent){ document.attachEvent("onclick", function(){ var event = window.event; }); } IE8 and prior by default use event bubbling. So I attached the event on document instead of body, so you need to use event object to get the target object. For IE you need to be very tricky.

Categories : Javascript



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