Login-GroceryCrud icon indicating copy to clipboard operation
Login-GroceryCrud copied to clipboard

Do you plan to support Grocery Crud Enterprise Edition?

Open yusuf-mutlu opened this issue 6 years ago • 36 comments

Hello,

I like this Login-GroceryCrud job. I have used this with grocery crud community edition and helped me a lot. Do you plan to support also Enterprise Edition? It would be amazing if you could. :)

yusuf-mutlu avatar Apr 08 '18 09:04 yusuf-mutlu

Thanks @RudyardKipling :) This plugin is optimized for GroceryCrud but it's basically matchable with any project! Give it a try and let me know, but I think I'll add the Enterprise Edition support.

portapipe avatar Apr 08 '18 09:04 portapipe

I have been trying to manage permissions for Enterprise Edition but i couldn't know how to set the library for Enterprise Edition.

image

yusuf-mutlu avatar Apr 08 '18 09:04 yusuf-mutlu

I think now i have some reasonable errors after setting up the library properly. :)

Reasonable Erors :)

yusuf-mutlu avatar Apr 08 '18 11:04 yusuf-mutlu

I have been trying to integrate Grocery Crud Enterprise with Codeigniter framework by the way. This Login-GroceryCrud integration really needs a grocery crud expert :)

yusuf-mutlu avatar Apr 08 '18 11:04 yusuf-mutlu

@RudyardKipling 403 on the screenshots you've sent for reasonable errors... I can help you integrate it, just post the errors and let's try...

portapipe avatar Apr 08 '18 12:04 portapipe

I am trying tests for grocery crud standart example database. When checking a table's permissions for a user i am having this error on Login_model.php on line 125

"Type: PDOException Message: You cannot serialize or unserialize PDO instances"

image

My code for test is: image

How can i solve this?

I solved this, i had to check crud before rendering. this is ok. :)

yusuf-mutlu avatar Apr 08 '18 16:04 yusuf-mutlu

1.) Now, i dont get errors for checking my crud with Login_model.php. But although i set edit, add and delete permissions for my crud, i cannot see edit, add, delete options on my crud.

Here is my code: image

And my output crud: image

2.) I can render manage_permissions without errors: image

But when i try to save my permissions i am having some ajax errors: image

yusuf-mutlu avatar Apr 08 '18 17:04 yusuf-mutlu

For 1st matter above i mentioned, i recognised something.

The problem is about check function in Login_model.php. Table name cannot be unserialized correctly. Because of this, every condition about crud returns false and it behaves like there is no permission.

If you can tell me how to debug crud variable, i can find a way.

image

yusuf-mutlu avatar Apr 08 '18 20:04 yusuf-mutlu

How many odds issues... I had to ask you what you need to do, then I can suggest stuff :P I thought you had to make a simple login but if you need some advanced stuff let me know which ones

portapipe avatar Apr 08 '18 20:04 portapipe

I know the issues i wrote looks like a mess :s I just want to make Login-GroceryCrud work for GroceryCrud EnterPrise like it works perfect for GroceryCrud Community edition. The simple usage is enough for me.

If i solve the 2 matters i wrote above, then everything will be fine. I really like Grocery Crud and your Login system, i have become fan of you and John by time. :))

Thanks for your kindness. :)

yusuf-mutlu avatar Apr 08 '18 21:04 yusuf-mutlu

Oh thanks man! I think @scoumbourdis will be happy for that. I think that I’ve saw the serialize issue once... I did a simple change that I don’t remember atm, it was tricky but few lines indeed... I’ll check that for you but if this is the only problem I think is fully compatible with the enterprise edition! 00:25 here, today I’m gonna check that for you :)

portapipe avatar Apr 08 '18 22:04 portapipe

Hello guys,

I would love to start using it in Grocery CRUD Enterprise and have an official example at the website. But as @portapipe already knows my time is very very limited and already promised him something that I still can't find the time to do. The good news is that everything is within a backlog so they will not be forgotten. The bad news is that my backlog is huge 😄

Currently working to finish the bootstrapV4 theme for grocery CRUD Enterprise that will be available probably this week (I will announce it in twitter) and at the same time I did finish creating a YouTube video (Which PHP Framework is best for you? 2018 update) and all of these on my public holidays (Orthodox Easter) but I like to work on these stuff so I am not regretting it :)

scoumbourdis avatar Apr 09 '18 04:04 scoumbourdis

Well that’s cool enough, built directly in the enterprise edition in the next future! For now let me go to work so I can take a look at the changes I did for that issue... Don’t worry John, I have a though moment at work too, plus new clients with jobs... but that jobs probably will need some extra stuff so... you know what I’m talking about ;)

portapipe avatar Apr 09 '18 05:04 portapipe

@scoumbourdis If you could make an official example about Login-GroceryCrud it would be wonderful. An easy to use awesome crud(Grocery Crud) and an easy to use awesome login system(Login-GroceryCrud), what can a developer want more for starting a project in lightning speed. :) Keep up the great work. My best wishes with who contributes to these projects. :)

yusuf-mutlu avatar Apr 09 '18 07:04 yusuf-mutlu

@RudyardKipling comment the first $state declaration and change the second one as following:

                /*
		$state = unserialize(
			preg_replace(
				'/^O:\d+:"[^"]++"/', 
				'O:'.strlen("portapipe").':"portapipe"',
				serialize($crud)
			)
		);
		*/
		//$state = json_encode((array)$state);
		$state = json_encode((array)$crud);
		$state2 = strpos($state,'basic_db_table":"');
		$state = str_replace('basic_db_tab.....................

and let me know if it works.

portapipe avatar Apr 09 '18 07:04 portapipe

@portapipe I have figured out that, there is no need to change unserialize or json_encode code. If I replace 'basic_db_table' with 'dbTableName' everything works fine.

//$state2 = strpos($state,'basic_db_table":"'); //$state = str_replace('basic_db_table":"','',substr($state, $state2));

$state2 = strpos($state,'dbTableName":"'); $state = str_replace('dbTableName":"','',substr($state, $state2));

1st problem i mentioned above is ok now. :)

Now i am trying to save manage_persmissions. I get some javascript error. If i solve this, too. I will be very happy. :))

yusuf-mutlu avatar Apr 09 '18 11:04 yusuf-mutlu

For the 2nd problem i have, it is because of difference between EnterPrise and Community Edition's callbackBeforeUpdate and callbackBeforeInsert functions. I have to rewrite Login-GroceryCrud's some functions:

image

yusuf-mutlu avatar Apr 09 '18 15:04 yusuf-mutlu

@RudyardKipling great work!

portapipe avatar Apr 09 '18 15:04 portapipe

Hey @RudyardKipling great work,

Can you please copy the example that you did use at https://gist.github.com/ so it will be easier for me to create examples for Grocery CRUD Enterprise?

Please just share your controller only as this is enough for people to understand.

Regards Johnny

scoumbourdis avatar Apr 09 '18 16:04 scoumbourdis

@scoumbourdis I am using codeigniter framework. Theese are the files i edited for Enterprise Edition.

You can reach Login.php's edited version from Login-GroceryCrud: https://gist.github.com/RudyardKipling/9b7ef9dc8cfbfdbcbc3fc335de223fb1

Examples controller: https://gist.github.com/RudyardKipling/695358b2f7e8e4820c88b614b167ad58

Login_model.php from Login-Grocery Crud. https://gist.github.com/RudyardKipling/800f3d54e3c52b98b0be464bb4bd6229

I want to make something clear. I couldn't make work manage_permissions function from Login.php. I still need help for this. :)

yusuf-mutlu avatar Apr 09 '18 17:04 yusuf-mutlu

I couldn't make "manage_permissions" functions work with GroceryCrud Enterprise edition. If it is solved, Login-GroceryCrud system will be fully compitable with GroceryCrud Enterprise edition.

I need some help plz. :/

image

yusuf-mutlu avatar Apr 10 '18 08:04 yusuf-mutlu

@RudyardKipling the error shown below tells nothing. You have to look inside the page you're calling and that throws error. A better debug can show the issue. I think is something related edited function names like "unset_edit/add/delete" or stuff like that. I'm not using Enterprise ATM so I can't help as I want but I'm here if you need more help.

portapipe avatar Apr 10 '18 09:04 portapipe

For the "manage_permissions" issue, after hours i have decided to use CommunityEdition for only "manage_permissions" function. Thats not a good way but somehow it is a solution. :D I will be using both Community and Enterprise Edition in my projects same time depends on the situation. Thanks for your kindness and helps.

yusuf-mutlu avatar Apr 10 '18 12:04 yusuf-mutlu

I just have to take a look on how the Enterprise Edition do stuff but with a bit of effort you could figure out by yourself :)

portapipe avatar Apr 12 '18 18:04 portapipe

Did you guys ever come up with a working login system for stand-alone Enterprise Edition or CodeIgniter package?

nyala1 avatar Aug 22 '18 04:08 nyala1

Hi nyala1. This Login system work with Codeigniter alone. The permission grid is the only one that require GroceryCrud at the moment. I’m secretly planning on create an enhanced version of it, but it will take some time and I’m having a high work requests since a year, but I want to revolutionize the permission management 🙂

portapipe avatar Aug 22 '18 06:08 portapipe

Hi, and thanks for your unexpectedly quick response. I'm happy that this projects till has your attention as it could be really useful. :)

The delay in my response is because I wanted to get it up and running before responding and I am stuck. I'm sure that I am doing something simple wrong as I have followed your instructions but I get a successful login message, "HI admin! You are Logged IN!" but then I get a model with, for starters, a parse error:"


We can't process the response of the server. This is all we know about it: Summary:parsererror Error:SyntaxError: Unexpected token H in JSON at position 0


I've tried everything I can think of but it must be outside my abilities. Any help I can get from you would be greatly appreciated. I just need to be pointed in the right direction:)

If you give me an email address I can send you a link to my sandbox so you can see for yourself.

Regards,

Marv

nyala1 avatar Aug 26 '18 06:08 nyala1

Hi @nyala1 , I think this is not a GCLogin related issue... I can suggest you to make a step-by-step code debug (like add a echo 'from here it's all fine';die; line by line on the page that throws that error) then came back here if it still happen.

portapipe avatar Aug 26 '18 06:08 portapipe

Hi, I've worked on this for some time and cannot figure it out. I can tell you however that if I add the GCLogin code to the function I want to be protected it fails and if I don't add it everything works so seems it is at least related to your code. For example the following throws the error but if I remove your code it works as expected. I'm at a loss unless I'm adding your code incorrectly.?

public function requests() { $this->load->model("login_model");

if($this->login_model->isLogged()){ $name = $this->login_model->name(); echo "HI $name! You are Logged IN!"; }else{ redirect("/login"); }_

		
    $crud = $this->_getGroceryCrudEnterprise();
    $crud->setTable('quotes');
    $crud->setSubject('Trip Request', 'Open Trip requests');
    $crud->columns(['id','qdate','origin','destination','date','pax','actype']);

		if ($crud->getState() === 'Initial') {
    $origin_dropdown = [];
    $this->db->distinct();
    $this->db->select('origin');
    $this->db->order_by('origin');
    foreach ($this->db->get('quotes')->result() as $row)`

nyala1 avatar Aug 27 '18 03:08 nyala1

The code seems fine... The error says that there is an unexpected H and the only one that I see is in the echo message... can you try to change it and see what’s going on? Try a line by line debug on that few lines...

portapipe avatar Aug 27 '18 05:08 portapipe