Search Results

Search found 25123 results on 1005 pages for 'domain model'.

Page 211/1005 | < Previous Page | 207 208 209 210 211 212 213 214 215 216 217 218  | Next Page >

  • how to setup rails Authenticity Token to work with multiple domains?

    - by bwizzy
    I'm building an app that uses subdomains as account handles (myaccount.domain.com) and I have my sessions configured to work across the sub-domains like so: config.action_controller.session = {:domain => '.domain.com'} In addition to the subdomain a user can input a real domain name when they are creating their account. My Nginx config is setup to watch for *.com *.net etc, and this is working to serve out the pages. The problem comes when a site visitor submits a comment form on a custom domain that was input by the user. The code is throwing an "Invalid AuthenticityToken" exception. I'm 99% sure this is because the domain the user is on isn't specified as the domain in the config.action_controller.session. Thus the authenticity token isn't getting matched up because Rails can't find their session. So, the question is: Can you set config.action_controller.session to more than 1 domain, and if so can you add / remove from that value at runtime without restarting the app?

    Read the article

  • PHP Detect if any URL variables have been set

    - by zuk1
    Hey guys, it's kind of hard to explain but basically I want to detect if any variables have been set through the URL. So with my IF statement all of the following should return true: http://domain.com/index.php?m=100 http://domain.com/index.php?q=harhar http://domain.com/index.php?variable=poo&crazy=yes and all the following return false: http://domain.com/index.php http://domain.com/test.php http://domain.com/no_variables.php Any ideas?

    Read the article

  • Django admin breaking with non-default primary_key for model with a m2m relationship ?

    - by Gj
    I have a simple Post model with a m2m field to a Tag model. The Tag had for some reason to use a non default primary key. Inside the admin page for a Post, the labels for the multiple selection field for Tags appear, but not the input field itself. I also tried using the filter_horizontal for the tags, but still only the labels appear without the actual field. Any ideas why it breaks and/or workarounds? Thanks!

    Read the article

  • Crashes in Core Data's Inferred Mapping Model Creation (Lightweight Migration). Threading Issue?

    - by enchilada
    I'm getting random crashes when creating an inferred mapping model (with Core Data's lightweight migration) within my application. By the way, I have to do it programmatically in my application while it is running. This is how I create this model (after I have made proper currentModel and newModel objects, of course): NSMappingModel *mappingModel = [NSMappingModel inferredMappingModelForSourceModel:currentModel destinationModel:newModel error:&error]; The problem is this: This method is crashing randomly. When it works, it works just fine without issues. But when it crashes, it crashes my application (instead of returning nil to signify that the method failed, as it should). By randomly, I mean that sometimes it happens and sometimes not. It is unpredictable. Now, here is the deal: I'm running this method in another thread. More precisely, it is located inside a block that is passed via GCD to run on the global main queue. I need to do this for my UI to appear crisp to the user, i.e. so that I can display a progress indicator while the work is underway. The strange thing seems to be that if I remove the GCD stuff and just let it run on the main thread, it seems to be working fine and never crashing. Thus, could it be because I'm running this on a different thread that this is crashing? I somehow find that weird because I don't believe I'm breaking any Core Data rules regarding multi-threading. In particular, I'm not passing any managed objects around, and whenever I need access to the MOC, I create a new MOC, i.e. I'm not relying on any MOC (or for that matter: anything) that has been created earlier on the main thread. Besides the little MOC stuff that occurs, occurs after the mapping model creation method, i.e. after the point at which the app crashes, so it can't possibly be a cause of the crashes under consideration here. All I'm doing is taking two MOMs and asking for a mapping model between them. That can't be wrong even under threading, now can it? Any ideas on what could be going on?

    Read the article

  • Adding MX records to DNS

    - by Teddy
    Let's say I have a computer A which is running postfix, computer B is running tinydns. On domain project.domain.com I'm running httpd server and other server with DNS (tinydns) have entries like =project.domain.com:1.2.3.4:86400 and +project.domain.com:1.2.3.4:86400 where 1.2.3.4 is correct addres for server which runs httpd server. I also have a postfix mail server on 1.2.3.5 which I'd like to work with this domain (project.domain.com). I'm afraid that if I add another alias like +project.domain.com:1.2.3.5:86400 to tinydns configuration - it could break. How that entry should look like? Thank you for any hints.

    Read the article

  • Qt – How to add calculated column in QsqlRelationalTableModel ?

    - by user289175
    I have an table view showed part description, quantity, price And I have a Model/View using this code model = new QSqlRelationalTableModel(this); model->setTable("parts"); model->setRelation(3,QSqlRelation("part_tbl","part_id","part_desc")); model->select(); ui->tableView->setModel(model); I need to add a new column that shows quantity * price in the table view. It's important to know I'm using QsqlRelationalTableModel Help is appreciated, Thanks in advance

    Read the article

  • Is it safe to put reference to current user in User model in Rails?

    - by Art Shayderov
    You know, I think I have to check current user in the model callbacks (like before_update). Rather than rely solely on adding where ('something.user_id = ?', 'current_user.id') in the controllers. I need something like Thread.CurrentPrincipal in .NET Is it safe to put reference to current user in User model? I'm sorry I don't really understand how it works under the hood yet. Or how you do it The Rails way? Sorry if this a silly question.

    Read the article

  • Upgrading Active Directory from 2000 to 2008

    - by Doug
    Our config is currently: 1 Windows 2000 domain controller running ISA2000, dhcp, dns 1 Windows 2003 domain controller as main file server, prob cert server as well, dhcp, dns 1 Windows 2008/Exchange2010 domain controller as Exchange server, DHCP,DNS Currently getting FRS errors on files server journalwrap error Currently getting FRS errors on othe DC's can't replicate from above Exchange DC holds Schema, rid,pdc, and infastructure roles File Server holds Domain namaing operation master role WOW, I didn't set this up, just inherited it. Am I right to assume that fixing the FRS errors is #1, what do I need to do for that? set enable journalwrap auto restore in registry? Demote W2000 domain controller, should that have any implications for ISA? We have Forefront to be deployed but that's another day Transfer Domain Nameing Role to Exchange server (I know or think having an Exchange server as DC isn't best practive) We will be getting another server W2008 to replace current file server and I thought it could takeover all roles once deployed Demote W2k3 file server and then raise functional domain level to 2008 Am I missing anything other that the sense to walk away? Thanks

    Read the article

  • glassfish - Unknown error when trying port 4848

    - by Majid Azimi
    I'm installing glassfish 3.1 on Windows XP service pack 3. but in configuration step it gives this error: PERFORMING THE REQUIRED CONFIGURATIONS ______________________________________ CREATING DOMAIN _______________ Executing command :C:\glassfish3\glassfish\bin\asadmin.bat --user admin --passwordfile C:\DOCUME~1\MAJIDA~1\LOCALS~1\Temp\glassfish-3.1-windows-ml.exe6\asadminTmp1079044298673991344.tmp create-domain --savelogin --checkports=false --adminport 4848 --instanceport 8080 --domainproperties=jms.port=7676:domain.jmxPort=8686:orb.listener.port=3700:http.ssl.port=8181:orb.ssl.port=3820:orb.mutualauth.port=3920 domain1 C:\glassfish3\glassfish\bin\asadmin.bat --user admin --passwordfile C:\DOCUME~1\MAJIDA~1\LOCALS~1\Temp\glassfish-3.1-windows-ml.exe6\asadminTmp5898014821156752751.tmp create-domain --savelogin --checkports=false --adminport 4848 --instanceport 8080 --domainproperties=jms.port=7676:domain.jmxPort=8686:orb.listener.port=3700:http.ssl.port=8181:orb.ssl.port=3820:orb.mutualauth.port=3920 domain1Unknown error when trying port 4848. Try a different port number. Command create-domain failed. CLI130 Could not create domain, domain1 I change 4848 to any other port. but it doesn't work. firewall is completely disabled. Could anyone help?

    Read the article

  • Bad practice to have models made up of other models?

    - by mattruma
    I have a situation where I have Model A that has a variety of properties. I have discovered that some of the properties are similar across other models. My thought was I could create Model B and Model C and have Model A be a composite with a Model B property and a Model C property. Just trying to determine if this is the best way to handle this situation.

    Read the article

  • iPhone SQLite connection in domain object - close each time?

    - by BahaiResearch.com
    I have what I would consider a small sized iPhone app that uses SQLite. There is a singleton domain object which gets data from a SQLite database. Is it better to create and open the SQLite connection for each request, or to open the DB once and hold on to it for the duration of the app. The app's reason for being is the domain object so other objects will not need the DB.

    Read the article

  • Locking down multiple sites in Sitecore

    - by adam
    Hi I have two sites running under one Sitecore 6 installation. The home nodes of the sites are as such: /sitecore/content/Home /sitecore/content/Careers Assuming the primary site is at domain.com, the careers site can be accessed at careers.domain.com. My problem is that, by prefixing the uri with /sitecore/content/, any sitecore item can be accessed by either (sub)domain. For example, I can get to: http://domain.com/sitecore/content/careers.aspx (should be under careers.domain.com) http://careers.domain.com/sitecore/content/home/destinations.aspx (should be under domain.com). I know I can redirect these urls (using IIS7 Redirects or ISAPIRewrite) but is there any way to 'lock' Sitecore down to only serve items under the configured home node for that domain? Thanks, Adam

    Read the article

  • Spring 3 MVC - Form Failure Causes Exception When Reloading JSP

    - by jboyd
    Using Spring 3 MVC, please bear with the long code example, it's quite simple, but I want to make sure all relevant information is posted. Basically here is the use case: There is a registration page, a user can login, OR fill out a registration form. The login form is a simple HTML form, the registration form is a more complicated, Spring bound form that uses a RegistrationFormData bean. Here is the relevant code: UserController.java ... @RequestMapping(value = "/login", method = RequestMethod.GET) public String login(Model model) { model.addAttribute("registrationInfo", new ProfileAdminFormData()); return "login"; } ... @RequestMapping(value = "/login.do", method = RequestMethod.POST) public String doLogin( @RequestParam(value = "userName") String userName, @RequestParam(value = "password") String password, Model model) { logger.info("login.do : userName=" + userName + ", password=" + password); try { getUser().login(userName, password); } catch (UserNotFoundException ex) { logger.error(ex); model.addAttribute("loginError", ex.getWebViewableErrorMessage()); return "login"; } return "redirect:/"; } ... @RequestMapping(value = "/register.do") public String register( @ModelAttribute(value = "registrationInfo") ProfileAdminFormData profileAdminFormData, BindingResult result, Model model) { //todo: redirect if (new RegistrationValidator(profileAdminFormData, result).validate()) { try { User().register(profileAdminFormData); return "index"; } catch (UserException ex) { logger.error(ex); model.addAttribute("registrationErrorMessage", ex.getWebViewableErrorMessage()); return "login"; } } return "login"; } and the JSP: ... <form:form commandName="registrationInfo" action="register.do"> ... So the problem here is that when login fails I get an exception because there is no bean "registrationInfo" in the model attributes. What I need is that regardless of the path through this controller that the "registrationInfo" bean is not null, that way if login fails, as opposed to registration, that bean is still in the model. As you can see I create the registrationInfo object explicitly in my controller in the method bound to "/login", which is what I thought was going to be kind of a setup method" Something doesn't feel right about the "/login" method which sets up the page, but I needed to that in order to get the page to render at all without throwing an exception because there is no "registrationInfo" model attribute, as needed by the form in the JSP

    Read the article

  • If I create a transient property in the model, isn't this managed by core data then?

    - by mystify
    Just to grok this: If I had a transient property, lets say averagePrice, and I mark that as "transient" in the data modeler: This will not be persistet, and no column will be created in SQLite for that? And: If I make my own NSManagedObject subclass with an averagePrice property, does it make any sense to model that property in the xcdatamodel file? Would it make a difference if I would simply create a property in my subclass and not model that in the entity? (I think: yes, it doesn't matter at all ... but not sure)

    Read the article

  • JPA: what is the proper pattern for iterating over large result sets?

    - by Caffeine Coma
    Let's say I have a table with millions of rows. Using JPA, what's the proper way to iterate over a query against that table, such that I don't have all an in-memory List with millions of objects? I suspect that the following will blow up if the table is large: List<Model> models = entityManager().createQuery("from Model m", Model.class).getResultList(); for (Model model : models) { // do something with model } Is pagination (looping and manually updating setFirstResult()/setMaxResult()) really the best solution?

    Read the article

  • Session sharing

    - by GeoXYZ
    Hello, i have a problem with Session sharing... I have a single web application hosted on a server. I created in IIS 2 different domains for the same application (thus each pointing to same physical path). The first domain is used as main interface, and the second domain is used to change settings (kind of like an admin). If the user logs in (login information is stored in session) the first domain, and then goes to the second one, he is also logged in there, which is OK. but when i try to change something in the session (like email address) from the second domain, the data is changed OK but only in the first domain; in the second one i still have the old data... also what i've noticed is that when redirecting from first domain to second domain, every postback control posts back to the first domain even though i am on the second one - this causes encryption errors with the viewstate... If anyone has any ideas, i would appreciate it... Thank you.

    Read the article

  • How to adjust asp.net URL routing based on domain/host?

    - by DrewF
    What's the best way to adjust the path destination for a routing table created in the global.asax Application_Start event based on the domain/sub domain/host? The following worked in IIS6, but with IIS7 the request object is decoupled from the Application_Start event and therefore does not work anymore: Dim strHost As String = Context.Request.Url.Host Dim strDir As String = "" If strHost.Contains("domain1.com") Then strDir = "area1/" Else strDir = "area2/" End If routes.MapPageRoute("Search", "Search", "~/" & strDir & "search.aspx")

    Read the article

  • ASP.NET MVC Unit Testing Controllers - Repositories

    - by Brian McCord
    This is more of an opinion seeking question, so there may not be a "right" answer, but I would welcome arguments as to why your answer is the "right" one. Given an MVC application that is using Entity Framework for the persistence engine, a repository layer, a service layer that basically defers to the repository, and a delete method on a controller that looks like this: public ActionResult Delete(State model) { try { if( model == null ) { return View( model ); } _stateService.Delete( model ); return RedirectToAction("Index"); } catch { return View( model ); } } I am looking for the proper way to Unit Test this. Currently, I have a fake repository that gets used in the service, and my unit test looks like this: [TestMethod] public void Delete_Post_Passes_With_State_4() { //Arrange var stateService = GetService(); var stateController = new StateController( stateService ); ViewResult result = stateController.Delete( 4 ) as ViewResult; var model = (State)result.ViewData.Model; //Act RedirectToRouteResult redirectResult = stateController.Delete( model ) as RedirectToRouteResult; stateController = new StateController( stateService ); var newresult = stateController.Delete( 4 ) as ViewResult; var newmodel = (State)newresult.ViewData.Model; //Assert Assert.AreEqual( redirectResult.RouteValues["action"], "Index" ); Assert.IsNull( newmodel ); } Is this overkill? Do I need to check to see if the record actually got deleted (as I already have Service and Repository tests that verify this)? Should I even use a fake repository here or would it make more sense just to mock the whole thing? The examples I'm looking at used this model of doing things, and I just copied it, but I'm really open to doing things in a "best practices" way. Thanks.

    Read the article

  • How to create a session in PHP when there is a session on the same domain in Rails?

    - by Tony
    I have a Rails app on a subdomain - xyz.domain.com, and a PHP app on another subdomain - abc.domain.com When a user is logged into the Rails app, I would like to give them a session so that I can log certain events about that user in the PHP app but in the same database of the Rails app. I would essentially just expose an API that requires authentication. What is the best way to go about this? I am not storing the session in a database

    Read the article

< Previous Page | 207 208 209 210 211 212 213 214 215 216 217 218  | Next Page >