w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to model database where different users/roles are in a project table, while all of them have to belong to user table?
I see three tables: USER, GROUP, and ROLE. Users would be assigned to groups, and groups given roles. I think you need three, not one. And cardinality matters: I can see where a USER could be assigned to many GROUPS; a GROUP could have many USERS; a ROLE could be assigned to several GROUPS; and a GROUP could have many ROLES. There are many to many JOIN tables as well: USER <-> USER_GROUP <-> GROUP <-> GROUP_ROLE <-> ROLE This is normalized - nothing is repeated this way. USER, GROUP, and ROLE have primary keys. The JOIN table primary key is a composite of the two IDs in each row.

Categories : PHP

MYSQL, Take value from 'reported users' table and use name to delete from another table
The best way to do it will be to use two commands in row: DELETE FROM male_users WHERE name IN( SELECT name FROM users WHERE <logic> AND gender='male' ); DELETE FROM female_users WHERE name IN( SELECT name FROM users WHERE <logic> AND gender='female' );

Categories : Mysql

Bluetooth app need to check for other users with the same app
From http://developer.android.com/guide/topics/connectivity/bluetooth.html "a Bluetooth device within the local area will respond to a discovery request only if it is currently enabled to be discoverable. If a device is discoverable, it will respond to the discovery request by sharing some information, such as the device name, *class,* and its unique MAC address. Using this information, the device performing discovery can then choose to initiate a connection to the discovered device. So i guess the device need to accept the connection to get more information about installed apps and other.

Categories : Java

I don't know what is wrong. Check if 2 users are friends in laravel
First of all, since you're using Laravel you should be using its built-in database functionality. Use the Schema builder to generate your database: http://laravel.com/docs/schema Second, make use of Eloquent's built in functionality for database relationships: http://laravel.com/docs/eloquent#many-to-many A quick example for your case would be something like this (I think): // app/models/user.php class User extends Eloquent { public function friends() { return $this->belongsToMany('User', 'friends', 'user_id', 'friend_id'); } } // app/database/schema/user.php Schema::create('users', function($table) { $table->increments('id'); $table->string('name'); // and any other stuff you want in your user database }); // app/database/schema/friend.php Schema:

Categories : Database

Check users in a security group in SQL Server
Accepted answer from DeanG is the preferred solution for getting this info within SQL Server You can use Active Directory tools for this. I like Active Directory Users and Computers that is part of the Remote Server Administration Tools. Follow the link to download and install the tools on Windows 7. Once installed, you can search for a specific group name: Then you can see group membership using the Members tab: If you don't want to use the AD browser packaged with RSA tools, there are several others available.

Categories : SQL

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

how to check and uncheck all checkboxes in an html table with checking/unchecking one check box?
Working Demo http://jsfiddle.net/xYAfj/2/ $('#allcb').change(function(){ if($(this).prop('checked')){ $('tbody tr td input[type="checkbox"]').each(function(){ $(this).prop('checked', true); }); }else{ $('tbody tr td input[type="checkbox"]').each(function(){ $(this).prop('checked', false); }); } }); Shorter Code Working Demo http://jsfiddle.net/cse_tushar/4tss8/ $('#allcb').change(function () { $('tbody tr td input[type="checkbox"]').prop('checked', $(this).prop('checked')); });

Categories : Jquery

Allow users to check start and end points in an embedded youtube video
For those of you that are unaware, you can already specify a starting point for Youtube videos in the embed code if you want to have a video start at a specific starting point within the video. In order to do that, you will need to utilize the start parameter whereby you will specify the starting point in seconds. The video below was embedded using the following code: <object width="425" height="344"> <param name="movie" value="http://www.youtube.com/v/Ye9hUGRZZA0&fs=1&start=59"></param> <param name="allowFullScreen" value="true"></param> <embed src="http://www.youtube.com/v/Ye9hUGRZZA0&fs=1&start=59" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed> </object> here is the clear

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#

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

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

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

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#

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

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

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

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#

SharePoint 2010 Check Permission shows "None" for Users added through AD Security Groups
http://blogs.technet.com/b/yashgoel-msft/archive/2012/04/13/check-permissions-showing-quot-none-quot-for-users-added-through-ad-groups-in-sharepoint-2010.aspx When you try to do checkpermissions for a user added on the site through AD group you get “none” even though group has permissions on the site and user also doesn’t have any issue in logging into the site. It’s just that the check permission doesn’t work for the group and the user. Resolution: Take a ULS while doing check permissions and if you see the following entry 04/02/2012 17:27:49.89 w3wp.exe (0x169C) 0x0974 SharePoint Foundation General 7fdb Unexpected AuthZInitializeContextFromSid failed! ddd8bfd7-3a2d-4b94-8249-0e22f057a52f This comes if the farm account

Categories : Sharepoint

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

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

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#

CakePHP: using a different users table
Best Solution: This is something that's done in the User model with the useTable property. I.e. in app/Model/User.php you should have something like this: class User extends AppModel { public $useTable = 'table_name'; //... rest of Model stuff here } Alternative: Alternatively you can specify a different model to be used for the user, although I don't think that's what you're asking for. If I'm wrong there though, just set the userModel value like this: public $components = array( 'Auth'=>array( 'authenticate'=>array( 'Form' => array('userModel' => 'ADifferentUserModel') )));

Categories : Cakephp

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#

select data from one table, check against and pull values from second table
From looking at your code, I am assuming the actions.action_int field correlates to the questions.id field, and I believe this is what you're asking for: SELECT actions.action_id, actions.action_type, actions.action_details, actions.action_int, actions.action_time, questions.section_id FROM actions JOIN questions ON actions.action_int = questions.id WHERE user_id = '".$id."' AND action_type = 'other' AND ( action_details = 'random question' OR action_details = 'review') AND action_int IN ( SELECT id FROM questions WHERE section_id IN (2,3,4,5,6,7,8) )

Categories : PHP

Find out max dates of all users in same table
Try this: SELECT imei, MAX(gpsdatetime) FROM data GROUP BY imei This query makes use of the GROUP BY clause. Demo on SQLFiddle. If you want all imei rows (even duplicates) then use the following query: SELECT a.imei, b.gpsdatetime FROM data a JOIN ( SELECT imei, MAX(gpsdatetime) as gpsdatetime FROM data GROUP BY imei ) b ON a.imei = b.imei Demo on SQLFiddle.

Categories : Mysql

How do I configure the Users context/table?
You can download a sample from https://github.com/rustd/AspnetIdentitySample. This is based on the ASP.NET MVC template that shipped with ASP.NET and Web Tools 2013 Preview Refresh (Supports English version of VS2013 Preview only) Once you have this Preview Refresh installed you can do the same for ASP.NET Web Forms and SPA applications. Following are the steps to Run this project Open the solution Build and run Register a user ---- Notice that the user registration field only has user name and password Let's ask for a birthdate option from the user while registering an account. Goto Nuget Package Manager console and run "Enable-Migrations" Goto ModelsAppModel.cs and uncomment BirthDate property in the MyUser class Goto ModelsAccountViewModels.cs and uncomment BirthDate property in Regis

Categories : Asp Net Mvc

How to modify MVC 4 Routing Table for Different Users?
There is no need to have different routing for the different user types. Simply define a route for each user type (/seller, /buyer) and redirect them accordingly. For security measure, you might want to add the Authorization attribute and specify a role so that only user in the appropriate roles can access that section.

Categories : Asp Net Mvc

Search for users through an associated table via ActiveRecord
For Rails 2.3, you want: User.find(:all, :conditions => 'profiles.first_name = "Tom"', :joins => :profile) If you want to eager load the profiles, you can use :include instead of :joins like so: User.find(:all, :conditions => 'profiles.first_name = "Tom"', :include => :profile) Rails 2.3 rolls pretty much everything into find, so check out the docs for find to see all the available options. Obviously, if you are interpolating user input into the name condition, be sure to sanitize it.

Categories : Ruby On Rails

Django1.5 Custom Users table
The error is that should be AUTH_PROFILE_MODEL = 'myaccount.User' instead of AUTH_PROFILE_MODULE = 'myaccount.User' Also you forgot a bunch of methods in your Model and a USERNAME_FIELD see a full example of how to build your own CUSTOM USER

Categories : Python

Send message to all users (Internal table)
You can do this insertion in one single query, and without the need to transfer any data from your database to PHP: INSERT INTO inbox SELECT NULL, users.id, @sender, @title, @message, @date FROM users

Categories : PHP

How can I allow users sql access to a table limited to certain rows?
Solution is SQL Views, Views are used for several different reasons: *1.*To hide data complexity. Instead of forcing your users to learn the T-SQL JOIN syntax you might wish to provide a view that runs a commonly requested SQL statement. *2.*To protect the data. If you have a table containing sensitive data in certain columns, you might wish to hide those columns from certain groups of users. For instance, customer names, addresses and their social security numbers might all be stored in the same table; however, for lower level employees like shipping clerks, you can create a view that only displays customer name and address. You can grant permissions to a view without allowing users to query the underlying tables. There are a couple of ways you might want to secure your data: a.Create

Categories : Mysql

How should I implement Doctor and Patient in one users table?
I think class_name will work class User < ActiveRecord::Base has_many :doctors, :class_name => 'User', :foreign_key => 'doctor_id' has_many :patients, :class_name => 'User', :foreign_key => 'patient_id' end class Case < ActiveRecord::Base belongs_to :doctor, :class_name => 'User', :foreign_key => 'doctor_id' belongs_to :patient, :class_name => 'User', :foreign_key => 'patient_id' end

Categories : Ruby On Rails

SQL Server Deny all users from a table except for one user
just the opposite: DENY INSERT, UPDATE, DELETE ON [dbo].[RAckNakLog] TO [svc-eR] If you already granted access to a user you need to revoke them (like delete GRANT or DENY) REVOKE INSERT, UPDATE, DELETE ON [dbo].[RAckNakLog] TO [svc-eR]

Categories : Sql Server

check all check boxes only in one table
You're passing the checkbox as me, so if you use that to find the closest table, it should work : checkBoxes = function (me) { $(me).closest("table").find('input[type="checkbox"]').not(me).prop('checked', me.checked); } FIDDLE

Categories : Javascript

Adding existing users from a table to a membership database
It does actually store passwords. You probably have it configured for ‘hashed’ passwords – so you can’t actually see the passwords in the table – only a 1 way hash of the passwords. If you set the passwordFormat to Clear, the passwords will be in plain text within the db. That being said, for security I do suggest you use Hashed. Do a search on google on how to hash your existing passwords so they can be put in the db in the correct format. But if you want to get it up and running quickly, use Clear and then Hash them in the future once you’ve got everything working. And just a note - the password field is on the aspnet_Membership table.

Categories : Sharepoint

Hide table row from other Users In Database if it is access by User
As i see in your comment,You can create new column or table to store id of user and flag accessed in that. While accessing records use this relationship. Or please elaborate your question and if possible provide an table structure

Categories : Sql Server

Does #temp table share data to multiple users?
A table that starts with a single hash, like #tblname, is a local temporary table. It is only visible to your current connection. In most cases, you're better off using the newer table variable. Example of a table variable: declare @tbl table (id int, col1 varchar(50)) The two hashes in ##tblname make it a global temporary table. It is visible to all connections.

Categories : SQL



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