Search Results

Search found 1372 results on 55 pages for 'userid'.

Page 31/55 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • Drupal html user id

    - by msindle
    I'm using Drupal 6.16: I think I have a pretty simple question. How can I get the current user id and put it in a menu tab. What I would like to happen is when the user logs in and wants to change their their name, email etc to click a menu tab. I image it would look something like this: http://domain.com/user/{userid}/edit Thanks in advance! msindle

    Read the article

  • Returning date from Stored procedure in ASP.Net/VB.Net

    - by Mo
    Hi, I want to execute a method on VB.Net to return a date which is in the stored procedure. I tried using ExecuteScalar but it doesnt work it retruns error 'Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query' Any help would be much appreciated please? thank you below is the code Public Function GetHolidaydate(ByVal struserID as String) As DateTime Dim objArgs1 As New clsSQLStoredProcedureParams objArgs1.Add("@userID", Me.Tag) objArgs1.Add("@Date", 0, 0, ParameterDirection.Output) Return (CDate(ExecuteScalar(clsLibrary.MyStoredProcedure.GetHolidayDate, objArgs1))) End Function

    Read the article

  • Zend_Auth / Zend_Session error and storing objects in Auth Storage

    - by Martin
    Hi All, I have been having a bit of a problem with Zend_Auth and keep getting an error within my Acl. Within my Login Controller I setup my Zend_Auth storage as follows $auth = Zend_Auth::getInstance(); $result = $auth->authenticate($adapter); if ($result->isValid()) { $userId = $adapter->getResultRowObject(array('user_id'), null)->user_id; $user = new User_Model_User; $users = new User_Model_UserMapper; $users->find($userId, $user); $auth->getStorage()->write( $user ); } This seems to work well and I am able to use the object stored in the Zend_Auth storage within View Helpers without any problems. The problem that I seem to be having is when I try to use this within my Acl, below is a snippet from my Acl, as soon as it gets to the if($auth->hasIdentity()) { line I get the exception detailed further down. The $user->getUserLevel() is a methord within the User Model that allows me to convert the user_level_id that is stored in the database to a meaning full name. I am assuming that the auto loader sees these kind of methords and tries to load all the classes that would be required. When looking at the exception it appears to be struggling to find the class as it is stored in a module, I have the Auto Loader Name Space setup in my application.ini. Could anyone help with resolving this? class App_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract { protected $_roleName; public function __construct() { $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) { $user = $auth->getIdentity(); $this->_roleName = strtolower($user->getUserLevel()); } else { $this->_roleName = 'guest'; } } } Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - \Web\library\Zend\Loader.php(Line:146): Error #2 include_once() [&lt;a href='function.include'&gt;function.include&lt;/a&gt;]: Failed opening 'Menu\Model\UserLevel.php' for inclusion (include_path='\Web\application/../library;\Web\library;.;C:\php5\pear') Array' in \Web\library\Zend\Session.php:493 Stack trace: #0 \Web\library\Zend\Session\Namespace.php(143): Zend_Session::start(true) #1 \Web\library\Zend\Auth\Storage\Session.php(87): Zend_Session_Namespace-&gt;__construct('Zend_Auth') #2 \Web\library\Zend\Auth.php(91): Zend_Auth_Storage_Session-&gt;__construct() #3 \Web\library\Zend\A in \Web\library\Zend\Session.php on line 493 Thanks, Martin

    Read the article

  • iphone secure network identification

    - by CocoaNewBee
    Hello!!! can anyone tell me (code sample woudl be awesome) how to get the the secure wi-fi userid and password for the current logged user on the iphone for example: Wi-fi settings for a network using WPA2 Enterprise (network/username/password) how can I found out who's logged for said network ?? Thanks in advance!!! Cheers

    Read the article

  • Active Directory validate service account and user accounts

    - by Padur
    Hello folks I have an issue here, I guess you all know what is AD service account and why it is used for, if not please see the below description ? SSL-Explorer requires a dedicated Active Directory account to use for authenticating AD users. This account serves as a link to your Active Directory database. If the Service Account is not found on your AD database then the SSL-Explorer service will not start. Well I have Active Directory service account details and user submitted login/password details.In the code below I validated service account by giving MEMBER_GRPUP and adminPassword and I check whether the user exists in Active Directory by submitting samaaccountname but my question here is how do I validate the password submitted for that user? I am not sure how to do this, I appreciate if anybody has any suggestions on this. Thanks for your time. public boolean validateUserFromActiveDirectory(String userId) { final String MEMBER_GROUP = "CN=asdadasd,OU=asdasdasd Accounts,OU=adasdas,OU=asdasdas,DC=asdasdas,DC=asdasdas,DC=adasdasd,DC=asdasdasd"; String employeeNumber = ""; final String LDAP_INIT_CTX = "com.sun.jndi.ldap.LdapCtxFactory"; final String LDAP_URL = "ldap://xx-ssssssss.eee.eee.eeeee.eeeee:636"; final String MY_ATTRS[] = { "employeeNumber" }; String adminPassword = "somepassword"; String securityProtocol = "ssl"; boolean isValidUser = false; try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, LDAP_INIT_CTX); env.put(Context.PROVIDER_URL, LDAP_URL); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.REFERRAL, "follow"); env.put(Context.SECURITY_PRINCIPAL, MEMBER_GROUP); env.put(Context.SECURITY_CREDENTIALS, adminPassword); env.put(Context.SECURITY_PROTOCOL, securityProtocol); //C:\Documents and Settings\yourusername\Local Settings\Temp File tf = File.createTempFile("adentTruststore", ".jks"); tf.deleteOnExit(); byte buffer[] = new byte[0x1000]; ClassLoader cl = JNDI.class.getClassLoader(); InputStream in = cl.getResourceAsStream( "someTruststore.jks"); FileOutputStream out = new FileOutputStream(tf); int cnt; while ((cnt = in.read(buffer)) != -1) out.write(buffer, 0, cnt); in.close(); out.close(); System.setProperty("javax.net.ssl.trustStore", tf .getAbsolutePath()); DirContext context = new InitialLdapContext(env, null); SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); NamingEnumeration results = context.search( "XX=ent,XX=abc,XX=aaaaa,XX=aaaa", "(sAMAccountName=" + userId + ")", searchControls); if (results != null && results.hasMore()) { //some logic } } } catch (Exception e) { e.printStackTrace(); } return isValidUser; }

    Read the article

  • Mssql dilemma, performance

    - by Woland
    Hello I am creating app where user can save options witch one is better? 1) to save into user table varchar feeld smthing like ('1,23,4354,34,3') query for this is select * from data where CHARINDEX ( 'L', Providers , 0 ) 0 2) create other table where user options are and just add rows select * from data where Providers in (select Providers from userdata where userid=100) thanks for help

    Read the article

  • Accessing session data outside Joomla

    - by Alec Smart
    Hello, I am trying to run an application outside Joomla (not as a plugin) and I would like to access the logged in user's information (userid). I am wondering how should I go about doing that? Is there a file which I can include? I tried using $_SESSION but it shows empty. Is there a simple solution to my problem? Thank you for your time.

    Read the article

  • Do session use cookies?

    - by Pandiya Chendur
    This is an interview question asked a month ago.... Do session use cookies? If so,how do they do so? Assume Session["UserId"]=1 how does this session variable uses cookies internally? If so, what will be the name of the cookie and what is the value of that cookie....

    Read the article

  • filter some data(row) in zend view

    - by Behrang
    I have 1.Table:user(userId,userName,userGroup) 2.Model:userModel 3.usercontroller there i a simple code: Controller: class UserController extends Zend_Controller_Action { public function getuser() { $userModel = new userModel(); $this-view-usergroup = $userModel; } } Model: class Model_UserGroupModel extends Zend_Db_Table_Abstract { public function getuser( { $select = $this-select(); return $this-fetchAll($select); } } view: please tell me what code I must insert in view to only have user with specific row like user with group teacher also i use partialoop???

    Read the article

  • Get HTTP Get parameters from Restlet Request

    - by Holograham
    I am trying to figure out how to get the parameters from a Restlet request object. my request comes in as /customer?userId=1 and I want to grab the parameter to pass to my DAO for the query. @Get("xml") public Representation toXml() throws ResourceException, Exception { try { //get param from request //call DAO with parameter } catch(Exception e) { throw e; } }

    Read the article

  • Login function runs different between local and server

    - by quangnd
    Here is my check login function: protected bool checkLoginStatus(String email, String password) { bool loginStatus = false; bool status = false; try { Connector.openConn(); String str = "SELECT * FROM [User]"; SqlCommand cmd = new SqlCommand(str, Connector.conn); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds, "tblUser"); //check valid foreach (DataRow dr in ds.Tables[0].Rows) { if (email == dr["Email"].ToString() && password == Connector.base64Decode(dr["Password"].ToString())) { Session["login_status"] = true; Session["username"] = dr["Name"].ToString(); Session["userId"] = dr["UserId"].ToString(); status = true; break; } } } catch (Exception ex) { } finally { Connector.closeConn(); } return status; } And call it at my aspx page: String email = Login1.UserName.Trim(); String password = Login1.Password.Trim(); if (checkLoginStatus(email, password)) Response.Redirect(homeSite); else lblFailure.Text = "Invalid!"; I ran this page at localhost successful! When I published it to server, this function only can run if email and password correct! Other, error occured: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) I tried open SQL Server 2008 Configuration Manager and enable SQL Server Browser service (Logon as:NT Authority/Local Service) but it stills error. (note: here is connection string of openConn() at Localhost (run on SQLEXpress 2005) connectionString="Data Source=MYLAPTOP\SQLEXPRESS;Initial Catalog=Spider_Vcms;Integrated Security=True" /> ) At server (run on SQL Server Enterprise 2008) connectionString="Data Source=SVR;Initial Catalog=Spider_Vcms;User Id=abc;password=123456;" /> anyone have an answer for my problem :( thanks a lot!

    Read the article

  • Parsing JSON with eval

    - by Neethusha
    I have this code: function useHttpResponse() { if (xmlhttp.readyState==4 ) { var response = eval('('+xmlhttp.responseText+')'); alert(response); for(i=0;i<response.Users.length;i++) alert(response.Users[i].UserId); } } When i alert, the first alert is "[object Object]" Why is that so? I need to remove that...how?

    Read the article

  • Search and replace

    - by zx
    Hi, I have a really large SQL dump around 400MB. It's in the following format, "INSERT INTO user VALUES('USERID', 'USERNAME', 'PASSWORD', '0', '0', 'EMAIL', 'GENDER', 'BIRTHDAY', '182', '13', '640', 'Married', 'Straight', '', 'Yes', 'Yes', '1146411153', '1216452123', '1149440844', '0', picture', '1', '0', '0', 'zip', '0', '', '0', '', '', '0')" Is there anyway I can just get the email and password out from that, I want to import the users into another table. Anyone know how I can do this and just get email-password stripped out from that content? Thank you in advance

    Read the article

  • What is the most elegant way to implement a business rule relating to a child collection in LINQ?

    - by AaronSieb
    I have two tables in my database: Wiki WikiId ... WikiUser WikiUserId (PK) WikiId UserId IsOwner ... These tables have a one (Wiki) to Many (WikiUser) relationship. How would I implement the following business rule in my LINQ entity classes: "A Wiki must have exactly one owner?" I've tried updating the tables as follows: Wiki WikiId (PK) OwnerId (FK to WikiUser) ... WikiUser WikiUserId (PK) WikiId UserId ... This enforces the constraint, but if I remove the owner's WikiUser record from the Wiki's WikiUser collection, I recieve an ugly SqlException. This seems like it would be difficult to catch and handle in the UI. Is there a way to perform this check before the SqlException is generated? A better way to structure my database? A way to catch and translate the SqlException to something more useful? Edit: I would prefer to keep the validation rules within the LINQ entity classes if possible. Edit 2: Some more details about my specific situation. In my application, the user should be able to remove users from the Wiki. They should be able to remove any user, except the user who is currently flagged as the "owner" of the Wiki (a Wiki must have exactly one owner at all times). In my control logic, I'd like to use something like this: wiki.WikiUsers.Remove(wikiUser); mRepository.Save(); And have any broken rules transferred to the UI layer. What I DON'T want to have to do is this: if(wikiUser.WikiUserId != wiki.OwnerId) { wiki.WikiUsers.Remove(wikiUser); mRepository.Save(); } else { //Handle errors. } I also don't particularly want to move the code to my repository (because there is nothing to indicate not to use the native Remove functions), so I also DON'T want code like this: mRepository.RemoveWikiUser(wiki, wikiUser) mRepository.Save(); This WOULD be acceptable: try { wiki.WikiUsers.Remove(wikiUser); mRepository.Save(); } catch(ValidationException ve) { //Display ve.Message } But this catches too many errors: try { wiki.WikiUsers.Remove(wikiUser); mRepository.Save(); } catch(SqlException se) { //Display se.Message } I would also PREFER NOT to explicitly call a business rule check (although it may become necessary): wiki.WIkiUsers.Remove(wikiUser); if(wiki.CheckRules()) { mRepository.Save(); } else { //Display broken rules }

    Read the article

  • I think my PHP app is being session hijacked?

    - by Mark Sandman
    Hi there, I have a php site that lets registered users login (with a valid passord) and sets up a session based on their UserID. However I'm pretty sure thisis being hijacked and I've found "new" files on my server I didn't put there. My site cleans all user input for SQL injections and XSS but this keeps happening. Has anyone got any ideas on how to solve this?

    Read the article

  • mysql select column from view problem

    - by haim evgi
    i create a view table like : CREATE VIEW ViewManager AS SELECT us.UserId AS 'Account Manager', ......... after that, when i run a query to select data from this view like : SELECT 'Account Manager' , .. from ViewManager then the data i get in this column is the text 'Account Manager' and not the value of the this columns. Is there a way to solve this ? Of course I can change the field name , but i want to know if there is another solution, thanks.

    Read the article

  • Intermittent "Specified cast is invalid" with StructureMap injected data context

    - by FreshCode
    I am intermittently getting an System.InvalidCastException: Specified cast is not valid. error in my repository layer when performing an abstracted SELECT query mapped with LINQ. The error can't be caused by a mismatched database schema since it works intermittently and it's on my local dev machine. Could it be because StructureMap is caching the data context between page requests? If so, how do I tell StructureMap v2.6.1 to inject a new data context argument into my repository for each request? Update: I found this question which correlates my hunch that something was being re-used. Looks like I need to call Dispose on my injected data context. Not sure how I'm going to do this to all my repositories without copypasting a lot of code. Edit: These errors are popping up all over the place whenever I refresh my local machine too quickly. Doesn't look like it's happening on my remote deployment box, but I can't be sure. I changed all my repositories' StructureMap life cycles to HttpContextScoped() and the error persists. Code: public ActionResult Index() { // error happens here, which queries my page repository var page = _branchService.GetPage("welcome"); if (page != null) ViewData["Welcome"] = page.Body; ... } Repository: GetPage boils down to a filtered query mapping in my page repository. public IQueryable<Page> GetPages() { var pages = from p in _db.Pages let categories = GetPageCategories(p.PageId) let revisions = GetRevisions(p.PageId) select new Page { ID = p.PageId, UserID = p.UserId, Slug = p.Slug, Title = p.Title, Description = p.Description, Body = p.Text, Date = p.Date, IsPublished = p.IsPublished, Categories = new LazyList<Category>(categories), Revisions = new LazyList<PageRevision>(revisions) }; return pages; } where _db is an injected data context as an argument, stored in a private variable which I reuse for SELECT queries. Error: Specified cast is not valid. Exception Details: System.InvalidCastException: Specified cast is not valid. Stack Trace: [InvalidCastException: Specified cast is not valid.] System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) +4539 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) +207 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +500 System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +50 System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +383 Manager.Controllers.SiteController.Index() in C:\Projects\Manager\Manager\Controllers\SiteController.cs:68 lambda_method(Closure , ControllerBase , Object[] ) +79 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +258 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39 System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +125 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +640 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +312 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +709 System.Web.Mvc.Controller.ExecuteCore() +162 System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +58 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +453 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371

    Read the article

  • what's wrong with this code?

    - by Piyush
    $child= array(); $i = 0; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $child[i] = $row['userId']; $i++; } $i = 0; while($i<=5) { echo $child[i]; $i++; } It is printing same value.

    Read the article

  • .Net Entity Framework SaveChanges is adding without add method

    - by tmfkmoney
    I'm new to the entity framework and I'm really confused about how savechanges works. There's probably a lot of code in my example which could be improved, but here's the problem I'm having. The user enters a bunch of picks. I make sure the user hasn't already entered those picks. Then I add the picks to the database. var db = new myModel() var predictionArray = ticker.Substring(1).Split(','); // Get rid of the initial comma. var user = Membership.GetUser(); var userId = Convert.ToInt32(user.ProviderUserKey); // Get the member with all his predictions for today. var memberQuery = (from member in db.Members where member.user_id == userId select new { member, predictions = from p in member.Predictions where p.start_date == null select p }).First(); // Load all the company ids. foreach (var prediction in memberQuery.predictions) { prediction.CompanyReference.Load(); } var picks = from prediction in predictionArray let data = prediction.Split(':') let companyTicker = data[0] where !(from i in memberQuery.predictions select i.Company.ticker).Contains(companyTicker) select new Prediction { Member = memberQuery.member, Company = db.Companies.Where(c => c.ticker == companyTicker).First(), is_up = data[1] == "up", // This turns up and down into true and false. }; // Save the records to the database. // HERE'S THE PART I DON'T UNDERSTAND. // This saves the records, even though I don't have db.AddToPredictions(pick) foreach (var pick in picks) { db.SaveChanges(); } // This does not save records when the db.SaveChanges outside of a loop of picks. db.SaveChanges(); foreach (var pick in picks) { } // This saves records, but it will insert all the picks exactly once no matter how many picks you have. //The fact you're skipping a pick makes no difference in what gets inserted. var counter = 1; foreach (var pick in picks) { if (counter == 2) { db.SaveChanges(); } counter++; } There's obviously something going on with the context I don't understand. I'm guessing I've somehow loaded my new picks as pending changes, but even if that's true I don't understand I have to loop over them to save changes. Can someone explain this to me?

    Read the article

  • Joins and subqueries in LINQ

    - by Brian
    I am trying to do a join with a sub query and can't seem to get it. Here is what is looks like working in sql. How do I get to to work in linq? SELECT po.*, p.PermissionID FROM PermissibleObjects po INNER JOIN PermissibleObjects_Permissions po_p ON (po.PermissibleObjectID = po_p.PermissibleObjectID) INNER JOIN Permissions p ON (po_p.PermissionID = p.PermissionID) LEFT OUTER JOIN ( SELECT u_po.PermissionID, u_po.PermissibleObjectID FROM Users_PermissibleObjects u_po WHERE u_po.UserID = '2F160457-7355-4B59-861F-9871A45FD166' ) used ON (p.PermissionID = used.PermissionID AND po.PermissibleObjectID = used.PermissibleObjectID) WHERE used.PermissionID is null

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >