Hi,
When I tried to sync application in the security module, I still sync those application that I have deleted from my project.
Is this a bug?
Hi,
When I tried to sync application in the security module, I still sync those application that I have deleted from my project.
Is this a bug?
If I understand right you talk about the sec_apps table. If you remove an app from your project the app is still in this table. You have to manually remove the app from the sec_apps table. Anyone correct me if I’m wrong.
I have removed that app from the sec_apps table but when I clicked sync app again, the app still will appear back into the sec_apps table.
I tried to search in my project folder for the app name, I could not find the app folder but I noticed there is a file “appname_ini.txt” in the project folder under _lib/friendly_url.
Anyone can kindly advise on this?
I?m facing the same issue with one annoying app I created and deleted months ago… everytime I sync apps it comes back again although I deleted it from the IDE and DB… so annoying.
The main problem comes from the fact that generated security code is only ONE WAY STREET. It is very hard to make changes after you generate the module. Certain values are stored directly in the code (instead some external database). Also the sec_users file makes no sense because the primary key is based on “login” (which is string) not the ID (Integer) as it should be.
SC uses internal SQLite database and that is where some data is stored. The rest is stored in INI and even PHP files (which is quite insane). Storing hard coded data or variavles in code is asking for trouble and causes tons of security issues. I would try to empty all “sec_” tables then try run it again. Before I would also remove all files from /temp folder and clear browser cache.
Hi,
Thanks for the clarification.
I have tried to remove all the “sec_” table and delete all the security module.
After which, I redo the security module. Strangely I still will sync back those deleted applications.
I think next time I will just create a test project to do any test application.
Create separate project for your Security, then test it. Use you original tables if you have any data ( or create new tables if not). Once it is working then you will have to re-create this same project within your main project. The bad news is that SYNC code is generated for the entire project. If you create your Security project outside of your main project you cannot simply go and import Sec project into main one (like ytou can do with other Apps). I often found that it takes less time to re-create an App that is mallfunctioning than tracing bugs.
All sync changes can be update in the generated code (PHP methods) but it takes more time than re-creating new App.
Since SCRIPTCASE v5 syncing Apps never worked for me. It only works when you create a new Security Module, then later it does all kind of garbage activity.
I notices in the code there is reference to the /fiendly_url/ folder so perhaps this is messed up,… I going to take a closer look at it
When you compile an application it creates a folder for that application in the APPLICATION subdirectory of your project AND an INI file in the “Application_Lib\friendly_url” directory. The sync apps utility reads the contents of these two directories and merges them … then looks for the application in the sec_apps table and, if not found, adds the application to sec_apps and sec_groups_apps tables.
The issue is - when you delete an application, it deletes the folder in the APPLICATION directory but not the INI file in the friendly url directory - so when you sync again, it puts back your deleted applications (although they have no folder).
Version 9.x added the option to “Check if app is published” - if you set this to yes (default) it will ignore those orphaned INI files. If it is set to NO, they will be included.
To cleanup and start fresh:
Delete all folders EXCEPT _lib in the applications directory.
In the _LIB directory, delete all of the INI files.
Delete the contents of the sec_apps table (if you have a foreign key setup it will also delete contents of sec_groups_apps) - you must use delete NOT empty table
If you don’t have a foreign key on the sec_groups_apps table, you will also have to empty that table
Recompile ALL of your applications (you can see it recreate the folders/ini files back if you watch)
Run the SYNC APPS utility again
In fact, when you synchronize then the database is filled with the file structure containing the applications. SC only appends / inserts, never deletes. It has been this way since I started SC. I created a small application for that to delete them from the security tables. Not a nice solution, but very effective