I have 2 asp.net web applications running in IIS7:
http://app1.local/
and
http://app2.local/
My host.ini file just maps the above urls to localhost:
::1 app1.local
::1 app2.local
I added the same machine key to both their web.config's.
When I sign into app2, and then go to app1, the call to Request.IsAuthenticated is false?
Should this work?
When a user clicks on the little red "x" a.k.a. the form close button on the form command bar, what even is activated besides FormClosed()
I know FormClosing() is called, but I cannot really stop the form from closing after my code is run. I want to be able to show a messagebox that asks if the user wants to exit the form or not. Obviously if they click no, I want the form to stay open, how would I do this?
How do you handle ajax requests when user is not authenticated?
Someone enters the page, leaves room for an hour, returns, adds comment on the page that goes throuh ajax using jQuery ($.post). Since he is not authenticated, method return RedirectToRoute result (redirects to login page). What do you do with it? How do you handle it on client side and how do you handle it in controller?
Hi all,
I have an OpenSSL client-side implementation that establishes a TLS (v1) connection successfully.
It works fine, untill I'm trying to use a subordinate CA certificate and not a root CA one.
What do I need to add to the code?
I use OpenSSL 00.9.8k.
Thanks.
Warning (2): Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/iframeworking/iframe/app/models/frame.php:7) [COREcake/libs/controller/controller.php, line 647]
here is the code from frame.php:
<?php
class Frame extends AppModel
{
var $name = 'Frame';
var $belongsTo = array('User' => array('className' => 'User', 'dependent' => true));
}
?>
So we got this function in PHP
strcmp(string $1,string $2) // returns -1,0, or 1;
We Do not however, have an intcmp(); So i created one:
function intcmp($a,$b) {
if((int)$a == (int)$b)return 0;
if((int)$a > (int)$b)return 1;
if((int)$a < (int)$b)return -1;
}
This just feels dirty. What do you all think?
I am using asp.net mvc and jquery to make ajax requests and when the session times out after an ajax request the full sigin page gets loaded into my ajax div.
How can I display a modal popup instead of making a redirect when a session times out?
I create a login form to bind to the ldap server, if successful, it creates a session (which the user's username is stored within), then I go to another page that has session_start(); and it works fine.
What I want to do now, is add code to test if that user is a member of a specific group.
So in theory, this is what I want to do
if(username session is valid) {
search ldap for user -> get list of groups user is member of
foreach(group they are member of) {
switch(group) {
case STAFF:
print 'they are member of staff group';
$access = true;
break;
default:
print 'not a member of STAFF group';
$access = false;
break;
}
if(group == STAFF) {
break;
}
}
if($access == TRUE) {
// you have access to the content on this page
} else {
// you do not have access to this page
}
}
How do I do a ldap_search w/o binding? I don't want to keep asking for their password on each page, and I can't pass their password thru a session.
Any help is appreciated.
Is there any way to tell, using just the ADODB.Connection object, whether or not it is currently involved in a transaction?
I'd love to be able to test this on the connect object itself, without relying on keeping a boolean next to it updated.
We're currently writing some software that we want to protect. We thought that registering a user's MAC address in a database upon activation of the software seemed viable; we can profile and grab that with a Java applet, (is there a better way?) so getting it isn't too much of a problem. However, we want their computer to only run the application, and download application files/updates from the server when their MAC address has been verified with their one on-file. We understand that this means a lockdown to one computer, but special changes can be made on request.
What would be the best way to verify their MAC address, to see if it exists in the database, and then serve them the files to run the application? (And to simply run it on subsequent requests, to prevent re-downloading.)
After asking:
http://stackoverflow.com/questions/3009740/ldap-user-data-caching-on-local-database
I want to cache LDAP user data in the application local database to allow fast queries.
How may I cache LDAP user data in the local database using Spring Security.
Hi guys,
I need to delete duplicate users in django (by duplicate I mean two or more users with the same email).
If your instance there are three records like this:
id email
3 [email protected]
56 [email protected]
90 [email protected]
I need to delete records 56 and 90 and leave the oldest record id - 3
Is there a way to quickly do this.
Thanks :)
Hi all. In my contact manager program I have been storing information by reading and writing comma delimited files for each individual contact, and storing notes in a file for each note, and I'm wondering how I could go about shrinking them all into one file effectively. I have attempted using data entry tools in the visual studio toolbox and template class, though I have never quite figured out how to use them. What would be especially convenient is if I could store data as data type IOwner (a class I created) as opposed to strings.
I'd also need to figure out how to tell the program what to do when a file is opened (I've noticed in the properties how to associate a file type with the program though am not sure how to tell it what to do when it's opened).
Edit:
How about rephrasing the question: I have a class IContact with various properties some of them being lists of other class objects. I have a public list of IContact. Can I write Contacts as List(Of IContact) to a file as opposed to a bunch of strings?
Second part of the question: I have associated .cms files with my program. But if a user opens the file, what code should the program run through in an attempt to deal with the file? This file is going to contain data that the program needs to read, how do I tell it to read a file when the program is opened vicariously because the file was opened?
Does this make the question clearer?
I was practicing my java and was trying to make a simple counter with rollover at max, but for some reason it isn't rolling over. Any advice?
public class HandTallyCounter {
private int max;
private int count;
public HandTallyCounter(int max) {
this.max = max;
count = 0;
}
public void click() {
if (count++ > max) {
count = 0;
}
}
public int getCount() {
return count;
}
public void reset() {
count = 0;
}
}
Hi everyone!
Im not sure about what authentification method I should use for my webservice. I've searched on SO, and found nothing that helped me.
Preliminary
Im building an application that uploads data from a local database to a server (running my webservice), where all records are merged and stored in a central database. I am currently binary serializing a DataTable, that holds a small fragment of the local database, where all uninteresting stuff is already filtered out. The byte[] (serialized DataTable), together with the userid and a hash of the users password is then uploaded to the webservice via SOAP. The application together with the webservice already work exactly like intended.
The Problem
The issue I am thinking about is now: What is if someone just sniffs the network traffic, 'steals' the users id and password hash to send his own SOAP message with modified data that corrupts my database?
Options
The approaches to solving that problem, I already thought of, are:
Using ssl + certificates for establishing the connection:
I dont really want to use ssl, I would prefer a simpler solution. After all, every information that is transfered to the webservice can be seen on the website later on. What I want to say is: there is no secret/financial/business-critical information, that has to be hidden. I think ssl would be sort of an overkill for that task.
Encrypting the byte[]:
I think that would be a performance killer, considering that the goal of the excercise was simply to authenticate the user.
Hashing the users password together with the data:
I kind of like the idea: Creating a checksum from the data, concatenating that checksum with the password-hash and hashing this whole thing again. That would assure the data was sent from this specific user, and the data wasnt modified.
The actual question
So, what do you think is the best approach in terms of meeting the following requirements?
Rather simple solution (As it doesnt have to be super secure; no secret/business-critical information transfered)
Easily implementable retrospectively (Dont want to write it all again :) )
Doesnt impact to much on performance
What do you think of my prefered solution, the last one in the list above?
Is there any alternative solution I didnt mention, that would fit better?
You dont have to answer every question in detail. Just push me in the right direction. I very much appreciate every well-grounded opinion.
Thanks in advance!
Hello,
Suppose we have 3 apps - appMain, app1 and app2.
Applications 1 and 2 are protected, they have is_secure: true and everything works fine with sfDoctrineGuard plugin.
A behavior I want to achieve is when a user is not authenticated, current application to forward him to another one, say appMain with defined module and action.
Is that possible? Or can someone tell me where to dig about security mechanisms in symfony?
I'm new to mysql, I'm trying to run Wordpress inmy windows desktop and it need Mysql.
I install everything with Web Platform Installer which provided by microsoft. I never seta root password for mysql and in final step of installing wordpressit askfor root password of mysql.
What is the default password for root (if there is one)
and how to change it?
I try
mysql -u root password '123'
but it show me
Access denied for user 'root@localhost' (using password:NO)
after this I try
mysql -u root -p
but it ask for a password which I don't have
Thank you in advance
So, I've been saving a .txt file from a website and using...
My.Computer.FileSystem.ReadAllText()
To put it into a string.
But I figured it'd be more efficient to just grab it directly.
How do I go about this?
Thank you.
Hi.
We have a form with ratings to submit for a certain restaurant. After the user has entered some values and wants to submit them, we check whether the user is logged in or not. If not, we display a login form and let the user put in his account data and redirect him to the restaurant he wanted to submit a rating for. The problem is, that after he successfully logged in himself, the submitted values are not saved to the database (which works fine if the user is already logged in). So I wondered if it is possible, to somehow save the data although the user is not logged in. I thought of maybe saving the filled values in a variable and have then automatically re-entered after we redirected the user. But I guess this wont work because we use
before_filter :login_required, :only => [ :create ]
So we couldnt even access the filled in values, since we display the login-form before the method has processed the values in the form, right?
Any idea how we can make rails to save the values or at least have them automatically re-entered to the form?
Thanks!
Is it possible to require the user be authenticated (logged in) when downloading ZIP files from my site? Note that I don't have direct control of IIS7. (I'm on a shared hosting account.)
I can't simply alter the access for a particular directory because many directories are involved and most contain other files that can be accessed freely.
I've Googled this a bit and found similar questions. But I've been unable to find this exact question.
I am trying to use the isAuthorized() method to do a check for an admin flag, but the function never seems to be called. Even when I set the function to always return false, it allows any user. It just seems like it isn't being called.
Do I need to do something more than setting $this-Auth-authorize = 'controller' ?
from /app/app_controller.php
class AppController extends Controller
{
var $components = array('Auth');
function beforeFilter()
{
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'pages', 'display' => 'home');
$this->Auth->logoutRedirect = '/';
$this->Auth->authorize = 'controller';
$this->Auth->userScope = array('User.active' => 1);
}
function isAuthorized()
{
if (strpos($this->action, "admin_") != false)
{
if ($this->Auth->user('isAdmin') == '0')
{
return false;
}
}
return true;
}
}
I have created a module in access 2007 that will update linked tables, but I wanted to run this module from vb6. I have tried this code from Microsoft, but it didnt work.
Sub AccessTest1()
Dim A As Object
Set A = CreateObject("Access.Application")
A.Visible = False
A.OpenCurrentDatabase (App.Path & "/DataBase/acc.accdb")
A.DoCmd.RunMacro "RefreshLinks"
End Sub
What I am aiming to do, is to allow my program to update all linked tables to new links, in case the program has been used on other computer
In case you want to take a look at the module program, here it is:
Sub CreateLinkedJetTable()
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Set cat = New ADOX.Catalog
' Open the catalog.
cat.ActiveConnection = CurrentProject.Connection
Set tbl = New ADOX.Table
' Create the new table.
tbl.Name = "Companies"
Set tbl.ParentCatalog = cat
' Set the properties to create the link.
tbl.Properties("Jet OLEDB:Link Datasource") = CurrentProject.Path & "/db3.mdb"
tbl.Properties("Jet OLEDB:Remote Table Name") = "Companies"
tbl.Properties("Jet OLEDB:Create Link") = True
' To link a table with a database password set the Link Provider String
' tbl.Properties("Jet OLEDB:Link Provider String") = "MS Access;PWD=Admin;"
' Append the table to the tables collection.
cat.Tables.Append tbl
Set cat = Nothing
End Sub
Sub RefreshLinks()
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Set cat = New ADOX.Catalog
' Open the catalog.
cat.ActiveConnection = CurrentProject.Connection
Set tbl = New ADOX.Table
For Each tbl In cat.Tables
' Verify that the table is a linked table.
If tbl.Type = "LINK" Then
tbl.Properties("Jet OLEDB:Link Datasource") = CurrentProject.Path & "/db3.mdb"
' To refresh a linked table with a database password set the Link Provider String
'tbl.Properties("Jet OLEDB:Link Provider String") = "MS Access;PWD=Admin;"
End If
Next
End Sub
I have a "Posts" and a "Users" controller. I use the Auth Component and I want that all users can visit "Post.index" but only logged in users can visit "User.index".
In my app_controller.php I have this
$this->Auth->allow('signup', 'confirm', 'index');
but with that all users can visit post.index and user.index. How can I specify a Controller in the allow-method?
This didn't work for me:
$this->Auth->allow('signup', 'confirm', 'Post.index');