KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: jcm464 on April 19, 2010, 09:15:15 am

Title: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 19, 2010, 09:15:15 am
Hi,

I would like to bypass the Admin Login panel and allow all registered users appart from admin@konakart.com direct access to the products panel.

So if I'm a konakart customer once I register I can access the products panel from the admin console. Idealy, I would like to give them access whitout the need of entering their user name and password.

Can you guys give me some direction on how to achieve this.

If this is not achievable I would like to maybe have the cat@konakart.com and password princess showing up on the login panel so the user simply needs to click submit. If I could at least automate this step it would be great so the system does the login in the background and the user accesses the product panel sraight on!

Thanking you in advance
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 19, 2010, 09:37:12 am
In the current version it is possible (because we do login behind the scenes for Liferay Integration) but it isn't obvious how to do it. In the next version we are introducing a servlet launcher where you'll be able to easily manage SSO and so obtain the functionality that you are looking for.
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 19, 2010, 11:37:04 am
Hi Julie,

Thank you for your prompt reply. Do you know were I can find the konakartadmin_welcome panel so I can try and achieve what I suggested in my last post i.e have the cat@konakart.com and password princess showing up on the login input fileds login panel so the user simply needs to click submit. If you have any ideas on how to automate this step it would be great so the system does the login in the background and the user accesses the product panel sraight on!

Thank you
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 19, 2010, 11:56:15 am
I'm afraid there is no welcome panel that you can edit. It's developed with Google GWT technology which generates java script.
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 19, 2010, 01:40:18 pm
Hi Julie,

Thank you for your prompt reply! Can you give me a clue on how to go about it just like you guys do with Liferay. As you said we do login behind the scenes for Liferay Integration.

Thank you Julie!

Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 19, 2010, 04:36:19 pm
You need to edit the file KonakartAdmin.html under \KonaKart\webapps\konakartadmin by adding a few lines where you insert the user name. Under Liferay this file is generated dynamically in order to invoke the admin app.

<html>
   <head>
      <link rel='stylesheet' href='KonakartAdmin.css'>
      <title>KonaKart Admin Application</title>
      <meta name="Version" content="4.2.0.1">
      <meta name="Date" content="3:47PM 18-Jan-2010 GMT">
   </head>
   <body>
       <div id="nowloading" style="position:absolute;left:50%;top:50%"><img src="loader.gif"/></div>
      <div id="kkAdmin"></div>
      <script language='javascript' src='konakartadmin.nocache.js'></script>
      <iframe id='__gwt_historyFrame' style='width:0;height:0;border:0'></iframe>
      <iframe id="__printingFrame" style="width:0;height:0;border:0"></iframe>
      <form id="kkUserForm" action="http://somesite.com/prog/adduser" method="post">
         <input type="hidden" name="user" value="admin@konakart.com">
      </form>
   </body>
</html>

Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 20, 2010, 08:52:01 am
Hi Julie,

Thank you for your prompt reply and help, it does work beautifully!

I do not wish to push my luck but I thought I might as well ask if you know of a possible way in which we can change the following code below to register an actual user of the konakart system (customer). Such as it checks its credentials (email and password) and allow him/her straight access to the product panel.

<form id="kkUserForm" action="http://somesite.com/prog/adduser" method="post">
         <input type="hidden" name="user" value="admin@konakart.com">
      </form>

Thank you Julie!
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 20, 2010, 09:06:54 am
That's actually what we do with Liferay. Could you give me some details of what product you are integrating with since this may help me give you a more accurate reply?
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 20, 2010, 11:17:46 am
Hi Julie,

Thank you for your prompt reply.

I'm customising konakart to enable customers from adding products onto the system. So, my line of thought is to have a customer register on the konakart front end application and once they are authenticated they are able to purchase products as well as sell their own items (trying to integrate konakart with konakartadmin)

To put it lightly, when the customer registers or signs in they are able to add their own products to the system. To achieve this they press the "add product button" and it automatically authenticates (email address and password) them as a customer and allows them straight access onto the konakartadmin product panel so they can add products.

Thank you Julie!
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 20, 2010, 06:13:01 pm
Have you thought of creating a customized insert product screen and then use the KonaKartAdmin API to insert the product. This would allow you to create a very "customer friendly screen" showing only the attributes that interest you and would not require all customers to be registered as admin users.
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 21, 2010, 09:33:33 am
Hi Julie,

Thank you for your reply.

I think you might right in your suggestion. I will give it a go and look through the API's on how to achieve that, however, I would very much appreciate if you could enlighten me on how to authenticate the users and allow them access to the admin add product panel.


<form id="kkUserForm" action="http://somesite.com/prog/adduser" method="post">
         <input type="hidden" name="user" value="admin@konakart.com">
      </form>

Thank you Julie!
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 21, 2010, 01:44:09 pm
What you could do is to not show them the add product button unless they have logged in to the store front app. Then when they do the add product you generate the html page on the fly that invokes the admin app and you use a an admin user that has a reduced role to only allow him to add products.
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 21, 2010, 01:54:09 pm
Hi Julie,

Thank you for your reply. I think that its probably the best way to go about it. Having said that, I will take into account what you said in your previous messages with regards to building a page within the konakart app to allow users to add products. I will try both methods and see which one suits the app the better.

Thank you Julie!
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 21, 2010, 02:06:51 pm
My concern is that the Admin App UI is really for administrators and not designed for an average eCommerce customer. You may find that you'll need a wizard driven UI to guide your customer since a product definition can be quite complex. By the way, what type of products are we talking about?
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 21, 2010, 03:34:15 pm
Hi Julie,

Thank you for your prompt reply. The shop will sell a wide spectrum of sports related equipment, so the actual attributes may actually be quite complex ranging from size, weight, height, width, manufacturers  etc. Also, the customers may also become sellers if they wish to sell their sports products online. Therefore, I was thinking on allowing access to the Admin Console/ Product panel so they can also define the relevant attributes to their items.

Basically, as the products may have many attributes I was thinking on having the user actually logging in to the AdminConsole with their own credentials (email address and password) and not as cat@konakart.com. If I could accomplish this I could then add a new attribute to either the product or customer class (customer_id for product || product_id for customer) to keep track of whom is selling what items.  I have tried to add a new seller table and add all the relevant classes and services, API calls etc, but in the end it got quite messy, so I decided to try a different route.

If you could give me an idea as to how to accomplish this I would very much appreciate it?

Thank you!
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 21, 2010, 05:26:19 pm
If you want to use their own credentials then you have to convert them into admin customers and associate them with a role.

The API is the most flexible solution for adding data to custom fields to keep track of things. Remember that the Admin App also uses the API, so by using the custom engine for the admin App you could intercept the API calls and add extra information.
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 21, 2010, 06:28:56 pm
Hi Julie,


Thank you for your reply.

"If you want to use their own credentials then you have to convert them into admin customers and associate them with a role."

The issue here is that I have to manually convert every single user into admin users. Basically, I have to log in to the admin console every day and assign them catalogue admin privileges. Do you know of a way to automate this process i.e once the user registers with the site they are automatically assign (by default) Catalog admin rights?

Thank you Julie!

Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: julie on April 21, 2010, 06:52:08 pm
You can do it using the Admin API when they register. i.e. If you can do it from the admin app then you can also do it from the admin API.
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 22, 2010, 01:31:12 pm
Hi Julie,

Thank you for your reply. I will try and do what you suggested this week.

Thank you Julie!
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 24, 2010, 11:19:02 am
Hi Julie,


I'm able to add a product and upload all 4 images in the konakart admin console and I'm also able to see image 1 in the store front. However, when I click on the picture to view the product details and further info I can not see any images at all(not showing 4 images in SelectProduct.do).

Any idea why I can not see the 4 images?

Thank you Julie!
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: greg on April 24, 2010, 12:52:11 pm
Our demo storefront application doesn't use images 2, 3 and 4.

It derives the names of the 9 images for each product from the name in image 1.

If you want your product images to behave like the demo products you need to define 9 images with this naming convention:   (change "image" below for your unique image name)

image.jpg                         (THIS IS THE ONE YOU DEFINE AS image 1)
image_1.jpg
image_1_big.jpg
image_2.jpg
image_2_big.jpg
image_3.jpg
image_3_big.jpg
image_4.jpg
image_4.big.jpg

This is only an example.  You can change the storefront application to display product images any way you like... eg. you could change it to display images 1 to 4 in whatever way you choose.

We merely provide an example with a neat little javascript viwer to get you started.
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 26, 2010, 01:41:58 pm
Hi Greg,


Thank you for your reply.

I have tried do add all 9 images and can now see all 4 images but when I click on the  picture I can not see larger version (big).

In the admin console there are 4 image fields to upload the pictures. Do I need to upload all 3 pictures for image (image, image_1,image_1_big) in image field 1 and do the same for the remaining set of pictures (image_2, image_2_big in image field 2) etc.

Thank you
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: greg on April 26, 2010, 02:11:53 pm
Can't you work it out by looking at the URL it's using?  My earlier explanation should be sufficient.
Title: Re: Bypass Admin Login - Straight onto Product Panel
Post by: jcm464 on April 26, 2010, 02:28:36 pm
Hi Greg,


Thank you for your reply.Got it to work at last.

regards