• Welcome to KonaKart Community Forum. Please login or sign up.
 

Different admin urls to different store

Started by Asset, February 14, 2012, 04:33:18 pm

Previous topic - Next topic

Asset

Dear all,

How can I provide different admin urls to different store?

Example: I have 2stores: store1 and store2. I want admin1 to access store1 with "store1.localhost:8780/konakartadmin" and admin2 access his store admin with "store2.localhost:8780/konakartadmin"

Appreciate your quick response

julie

You can specify the store id in KonakartAdmin.html so that a store drop list isn't shown. You can create two different KonakartAdmin.html files pointing to store1 and to store2 and use different URLs to pick up one or the other.

Asset

Thanks Julie for your reply.

I thought in the solution of making 2 htmls but how can I make different urls and pick one of them? do you mean that I have to make rewrite rule for example ?

julie

Yes you could do that or instead of using KonakartAdmin.html create a couple of copies called store1.html and store2.html in which you put the id of the store. Then you can use:

localhost:8780/konakartadmin/store1.html and localhost:8780/konakartadmin/store2.html

Asset

Thanks Julie but my problem is that we are creating the stores dynamically. So i can not create html for each store as I don't know how many store I will have?

Is there any way to change in konakartadmin.html to have free text box (not combo box) to let the admin enter the store name/id he want??

julie

You could just create one every time you create a store. Otherwise you can easily create your own front end JSP that takes the store id from an entry field and forwards the user to a page it creates that looks just like konakartadmin.html except that it has the store id as well.

Asset

Sorry Julie for disturbance but I don't understand how can I create a page like konakartadmin.html and already this html include only "konakartadmin.nocache.5.7.5.0.7154.js'" this is generated from gwt??

Could you please clarify more?

Thanks for your help.


julie

You only have to create a page containing the same html as konakartadmin.html and direct the browser to it. The browser will then download the java script.

Asset

Really sorry Julie. But  I didn't get ur point. If I will create new page that contains the same konakartadmin.html so what the difference i will get??

Here is my new jsp or html:

<html>
   <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <link rel='stylesheet' href='KonakartAdmin.css'>
      <title>Store 1 KonaKart Admin Application</title>
      <meta name="Version" content="5.7.5.0">
      <meta name="Date" content="1:41PM 13-Oct-2011 BST">
   </head>
   <body>
       <div id="nowloading" style="position:absolute;left:50%;top:50%"><img src="loader.gif"/></div>
      <div id="kkAdmin"></div>
      <iframe id='__gwt_historyFrame' style='width:0;height:0;border:0'></iframe>
      <iframe id="__printingFrame" style="width:0;height:0;border:0"></iframe>
      <input type="text" id="userName" name="userName"/>
      <input type="text" id="password" name="password"/>
      <input type="hidden" name="store" value="store1">
   </body>
</html>

this code will never work for sure:S

julie

The difference is that you create it dynamically and put in a different store id depending on what the customer types in the entry field.

Asset

thanks Julie so much for ur great help. It works fine with me but I have more question can I do the same with the username for example?? to send it with the store id and save it in a hidden values??

julie

You can add the name but you need to add the password as well.

Asset

I tried to add the name and password as follows but it doesn't work:

<input type="hidden" name="name" value="store1-admin@konakart.com">
Or
<input type="hidden" name="username" value="store1-admin@konakart.com">

and also i tried to set the password

<input type="hidden" name="password" value="******">

The main purpose of doing that is to have only one jsp that the admin enter:username,password and store then send this data to konakartAdmin.html to login

julie


      <input type="text" name="user" value="cat@konakart.com"/>
      <input type="text" name="password" value="princess"/>
            <input type="hidden" name="store" value="store1">

Asset