Croogo, multiple sites and user permissions

2013-11-02 Thread bs28723
I am thinking about using Croogo for a new project. I need to create multiple sites (multiple domains) and need each site to look independent, so they have their own pages, content, and editors (users). Each editor should only see their site and content from the admin side. Anyone have some sug

Re: Yet another "Call to a member function find on a non-object" error

2012-11-13 Thread bs28723
I don't think you provided enough info for anyone to help you. Please provide the function and point out the line that is getting the error. Thanks, Bill Stoltz On Nov 13, 2012, at 10:31 PM, "Andrew Johnston [via CakePHP]" wrote: > I know this post gets written every couple of months, and I

Re: delete image "file" in server from controller

2012-11-12 Thread bs28723
You did not specify which line is getting the error. I am guessing one of the File lines Have you tried... $file = new File(WWW_ROOT ."/img/group-banners/banner/".$group['Group']['id']."-".$group['Group']['photo_secret'].".jpg"); On 11/12/2012 9:51 AM, chris...@yahoo.com [via CakePHP] wr

Re: Routing Help

2012-11-03 Thread bs28723
What I would guess is happening is that the new route you put in place is matching everything including all the actions for your products controller. You might be able to add routes for each action in products to override this. But, could you just make a sim

Re: add subquery to every find-statement in beforeFind

2012-11-03 Thread bs28723
Since you may not want to do this for every find call for your model, you might want to setup a custom find type. Then you could either add additional conditions and nested conditions & sub-queries to the original request, or possibly use the Model::query() call

Re: Copy branch of Tree to another parent

2012-10-24 Thread bs28723
ode3 > |--Node4 >|--Node5 > > On 10/22/2012 12:27 AM, Jeremy Burns | Class Outfit [via CakePHP] wrote: >> Surely you can just change the parent_id of the top of the branch you >> want to move? Then let the Tree behaviour take care

Re: Allow special characters in HtmlHelper

2012-10-23 Thread bs28723
Thanks Chetan & Marcus. On 10/23/2012 12:23 AM, chetan varshney [via CakePHP] wrote: > > Use this for example $imgTag = $this->Html->image($image['Image'] > ['thumb_path'], array( 'alt' => $title )); $options = array('class' => > 'thumb', 'name' => trim(Inflector::slug($title)), 'title' => > tr

Allow special characters in HtmlHelper

2012-10-22 Thread bs28723
I would like to use Html->image and Html->link together, but Html->link will convert characters like <, ", etc to htmlize them. for example             $imgTag = $this->Html->image($image['Image']['thumb_path'], array( 'alt' => $title ));    

Re: Copy branch of Tree to another parent

2012-10-22 Thread bs28723
w.classoutfit.com > > On 21 Oct 2012, at 23:24:53, bs28723 <[hidden email] > > wrote: > >> Hi, >> I am using the tree behavior for one of my models, and I want to >> copy a branch of a tree, with all the sub-branches, leafs etc to another >> parent. >>

Copy branch of Tree to another parent

2012-10-21 Thread bs28723
Hi, I am using the tree behavior for one of my models, and I want to copy a branch of a tree, with all the sub-branches, leafs etc to another parent. It looks like I am going to have to get a list of the children of the copy from node, and then do a save for each new node. would it work to d

Re: password_recovery find('first' condition email

2012-10-02 Thread bs28723
You may need to quote the email address or escape the "@" so that mysql does not think the email address is a mysql variable... On 10/2/2012 5:00 PM, chris...@yahoo.com [via CakePHP] wrote: > hi guys,... I have a password recovery function can't make it work,... > on 1.3CAKE > I'm getting erro

Should this be a plugin?

2012-09-30 Thread bs28723
I am working on some code (2 controllers + 2 models) that track calendar events or shows and locations. I have 2 projects this might work in, but only about 50-60% would be common. Should I just not worry about a plugin to share common code? If I do a plugin for the 50% that is common, how should

Re: How to Extend a plugin?

2012-09-03 Thread bs28723
I read my post, and it seemed confusing, so let me try to clarify. I have a plugin, that has some basic functionality, but I need to add things to it. I see 2 options. 1) install and modify code to meet my needs. But this creates 2 plugins. Original & modified. or 2) install but use some callbacks

How to Extend a plugin?

2012-09-02 Thread bs28723
I have a plugin that has some basic set of functions. I want to be able to Extend this plugin, without having to go in an edit the code. I would like to do things like add extra fields to the Table and have the Views, Model and Controller be able to handle this. I would also like to add some para

Re: How to automatically add plugin css / scripts to default layout

2012-08-12 Thread bs28723
arams['plugin']=='usermgmt') {             echo $this->Html->css('/usermgmt/css/umstyle');         } Chetan Varshney Cakephp User Mgmt Plugin  On Sunday, August 12, 2012 3:34:05 AM UTC+5:30, bs28723 wrote:

How to automatically add plugin css / scripts to default layout

2012-08-11 Thread bs28723
I have a plugin that has custom CSS and JS files. The plugin does not need its own layout - it will use the apps default layout. I guess I could just brute force it and put the $this->Html->css() and $this->Html->script() calls into the layouts/default.ctp file. but I was wondering, is there a

Cakephp 2.X image and gallery plugin?

2012-07-29 Thread bs28723
Before I build it myself, I am looking for a plugin or something I can start from that will upload images, create galleries or albums to manage a collection of images. I have done a number of search and there are plugins to do multiple uploads, or attach images to a model. There are jquery plugins

Re: Concepts I'm still not sure of...

2012-06-24 Thread bs28723
It was recently discussed in another thread in this group, I am paraphrasing, You need to spend time making sure your data Models are well thought out before you worry about where the code goes. A typical way to solve the website order problem is that you have

Re: Database structure question

2012-06-07 Thread bs28723
Looks like you are saying that Owner & Chronicle models hasMany domains. a Domain leaf can only have 1 owner & 1 chronicle. This creates a unique key that identifies a specific domain branch. I think a lot depends on what other information you might want to have related to the domain, owner,

Re: Looking for MVC & CakePHP Best practice doc, examples for Med to large sites

2012-06-07 Thread bs28723
urpose is to read and write Objects from/to the database instead of > arrays. Other systems are tied in to a form of the ActiveRecord > pattern which is a decent enough Domain model and this is a direction > I would like to see Cake head in ... but not at the expense of what it > alread

Re: Associative model validation fails, but does not report.

2012-06-07 Thread bs28723
Just a thought - do you have the saveAssociated set to Atomic? and does the DB support this? I have not done a lot of testing on this, but i had to change the table defaults to innoDB to support transactions, mySQL defaults to MyISAM. On 6/7/2012 1:10 AM, Michael Gaiser [via CakePHP] wrote: > So

Re: Looking for MVC & CakePHP Best practice doc, examples for Med to large sites

2012-06-07 Thread bs28723
On 6/6/2012 11:22 PM, John Hardy [via CakePHP] wrote: > i dont usually reply to messages but this one slapped me in the face. > Not sure what you mean by this - but I hope is was not bad - LOL Thanks for the help and suggestions. -- View this message in context: http://cakephp.1045679.n5.nabble

Re: Looking for MVC & CakePHP Best practice doc, examples for Med to large sites

2012-06-07 Thread bs28723
On 6/6/2012 10:19 PM, Justin Edwards [via CakePHP] wrote: > > For development as you go along, you'd naturally take your controller > methods and turn them into components where you'd see they'd need to > be reused, the same with helpers. exactly. I have already started doing this on my project.

Re: Looking for MVC & CakePHP Best practice doc, examples for Med to large sites

2012-06-06 Thread bs28723
iours, components and helpers to achieve >> what you want. >> >> Good examples of this can be found in the CakeDC github repository >> and I think this is a good a repository as any to see good Cake >> coding practises. >> >> https://github.com/CakeDC &g

Re: Looking for MVC & CakePHP Best practice doc, examples for Med to large sites

2012-06-06 Thread bs28723
My apology if I offended anyone. I have written and rewritten my share of bad code. I have probably even posted a few examples of my bad code in this group. I was just trying to see if this was the right forum for an architecture discussion. Mike - I saw your apology and it was not needed. It w

Re: Looking for MVC & CakePHP Best practice doc, examples for Med to large sites

2012-06-06 Thread bs28723
you can always rewrite bad code, > but it's much more difficult to transform shitty data. > > Read the bottom of this post by Torvalds, Words to engineer by…. > > > http://lwn.net/Articles/193245/ > > > On Jun 5, 2012, at 7:28 PM, bs28723 wrote: > >> anyone

Re: paypal on cakephp 2.x?

2012-06-05 Thread bs28723
Ok, This does not seem popular - so what do people use for payments with cakephp? On Sunday, June 3, 2012 1:54:00 AM UTC-4, bs28723 wrote: > > Anyone tried to get the CakePHP-Paypal-IPN-Plugin by webtechnick to > work with CakePHP 2.X? or is there a bett

Re: Looking for MVC & CakePHP Best practice doc, examples for Med to large sites

2012-06-05 Thread bs28723
te maintainable app. > However nothing is ever 100 perfect for all situations, learn from writing > your own shitty code and do not get caught in the spiral of over > engineering. Keep it simple and clever. > On Jun 2, 2012 11:18 AM, "bs28723" wrote: > >> I a

paypal on cakephp 2.x?

2012-06-02 Thread bs28723
Anyone tried to get the CakePHP-Paypal-IPN-Plugin by webtechnick to work with CakePHP 2.X? or is there a better option? -- View this message in context: http://cakephp.1045679.n5.nabble.com/paypal-on-cakephp-2-x-tp5708491.html Sent from the CakePHP mailing list archive at Nabble.com. -- Ou

saveAssociated vs multiple saves and which controller or model?

2012-06-02 Thread bs28723
I have the need to create an action called "changeOwner" that will change a bunch of fields in several associated tables, then return to the calling page. It does not have its own view, so it does not get data to fill out a form and post it back, like the edit action would. I would like to us

Is using Elements the best way to build menus?

2012-06-02 Thread bs28723
Right now, I am building out menus and they are all static, but, certain ones should only be displayed on certain pages. I have created some nested elements and variables passed in from the controller to each element to decide what to display. It seems to work w

Looking for MVC & CakePHP Best practice doc, examples for Med to large sites

2012-06-02 Thread bs28723
I am probably looking for something that does not exist online, but only in a few folks heads. :-) But maybe some parts of this exists. You never know unless you ask.. I am quickly learning a lot about MVC architecture and CakePHP over the last couple months. The cookbook, lots of trial an

Re: error code from delete or beforeDelete?

2012-05-30 Thread bs28723
){ > // If isDeletable has done it's job, this should never happen. > $this->log( $e->message(), 'error' ); > > } > } > > Not only is this cleaner, but the model is FAR easier to write test > cases for. > > Steve (

Re: error code from delete or beforeDelete?

2012-05-29 Thread bs28723
Thanks @stork & @steve-2 for the examples - great stuff! Can either of you, give me some best practices for exceptions processing? Maybe it is my self-taught PHP & CakePHP experiences but I have not a done a lot with exceptions. Is this efficient? Any good references to do some reading on t

Re: error code from delete or beforeDelete?

2012-05-28 Thread bs28723
I need to do more reading on Exceptions, but my case seems more like a flash message than throwing an exception. Maybe I need to do more checking in the controller, rather than using beforeDelete. This way, upon entry into delete method, I could check

error code from delete or beforeDelete?

2012-05-28 Thread bs28723
This has got to be a newbie question. I have searched, but can't seem to find an answer. Is there a way to get an error code for why the delete or beforeDelete failed and have this passed back to the Controller instead of just false? using the exa

Re: Can't call Auth component from controller

2012-05-16 Thread bs28723
he $components array. If you're extending that component you need to load 'OrgAuthorize'. On Sun, May 13, 2012 at 5:51 PM, bs28723 < [hidden email] > wrote: > I wrote an Auth Component. It gets a b

Re: How to tell if it's an edit or create action?

2012-05-14 Thread bs28723
I am not sure if adding exists() to beforeSave is another DB query or not. But, why not add a field in your add and edit functions? function admin_add($id = null) { // other checks if ($this->request->isPost() || $this->request->isPut()) { $this->request->data['new'] = true;

Re: Login / idle timeout

2012-05-14 Thread bs28723
? Not sure if cake touches the session for you on each page > load, to prevent it from expiring? > > On Monday, 14 May 2012 03:04:10 UTC+1, bs28723 wrote: > > Is a user's login controlled by session timeout? > What is the default session timeout if not set in confi

Login / idle timeout

2012-05-13 Thread bs28723
Is a user's login controlled by session timeout? What is the default session timeout if not set in configuration? In my testing, a user logins, and things work for several hours, but even if active, the account seems to timeout and I have to login. Is this normal? So this is not an 'idle timeout

Can't call Auth component from controller

2012-05-13 Thread bs28723
I wrote an Auth Component. It gets a bunch of permission information about the current user. How can I pass this information back to the controller? In AppContoller.php     public $components = array(     'Auth' => array(     'login

Is session variable a good place to store authorization info?

2012-05-12 Thread bs28723
I created a Auth component to do some special authorization checking. The Auth component gets called first before any controller isAuthorized routines. I was thinking about saving some permissions in a session variable inside the Auth component. Then the controller could get this detail and pe

Re: CakePHP Containable on Associated Model

2012-05-07 Thread bs28723
     Empty log array Book 2      log array, userid = 2 Book 3      log array, userid = 2      log array, userid = 3 That third book, where the extra log is returned is what I don't

Re: How to avoid extra php code in views

2012-05-07 Thread bs28723
'll have exponential more code.  Types of admins can be different prefixes.   Organization Admin, User Admin, etc.    Just some things to consider.   I'm in a similar boat.  On Mon, May 7, 2012 at 12:03 PM, bs28723

Re: How to avoid extra php code in views

2012-05-07 Thread bs28723
sure security component is always included in > every controller from now to the end of time, you may well find that > the duplication required by prefix routing may well be a justifiable > option. Additionally, I would probably say this approach would > cultivate a more secure and

Re: Auth allow bug? or feature?

2012-05-06 Thread bs28723
Thanks.  looks like 2.1 has a new way to do this... $this->Auth->allow(); finds every public method and adds this to the allow array. Thanks, I read that page several times, but missed that subtle difference.  On 5/6/2012 11:10 AM, stork [via Cak

How to avoid extra php code in views

2012-05-06 Thread bs28723
There should be a better way than what I am doing right now.. I have a set of 3 default Roles (Owner, Admin, Member). users can add, delete, modify the Roles, except the 3 Default Roles. If I create views like "edit", then all the fields in the Role table, go into a Form and are editable.

Auth allow bug? or feature?

2012-05-06 Thread bs28723
In my AppController beforeFilter() - I have an $this->Auth->allow('display'); Then in another controller I do class AddressesController extends AppController { public function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('*'); debug($this->Auth,1,

Re: Authorize component ordering

2012-05-06 Thread bs28723
Thanks. works great. On 5/6/2012 3:33 AM, stork [via CakePHP] wrote: > array_unshift($this->Auth->authorize, 'Org'); -- View this message in context: http://cakephp.1045679.n5.nabble.com/Authorize-component-ordering-tp5688772p5689248.html Sent from the CakePHP mailing list archive at Nabble.com

Re: CakePHP Containable on Associated Model

2012-05-05 Thread bs28723
Are you looking for a find where  "Log.user_id=2 OR Book.log_id = null"? On 5/3/2012 11:00 PM, Rob-3 [via CakePHP] wrote: I have a setup where there are Books Users and Logs. Each Log has a Book and a User and I am trying to retrieve a list o

Authorize component ordering

2012-05-05 Thread bs28723
I am trying to set the order for my Authorize components. I have a App/Controller/Component/Auth/OrgAuthorize.php I have tried starting with in AppController public $components = array( 'Auth' => array( 'authorize' => array('Controller') ) ); Then in m

Re: Can you dynamically change CSS for a layout per user?

2012-04-29 Thread bs28723
filenames: if ($css = $this->Auth->user('css')) {     $this->Html->css("users/${css}"); } On Sat, Apr 28, 2012 at 7:09 PM, bs28723 < [hidden email] > wrote:

Re: How can I pass parameters to controller/action not in URL?

2012-04-29 Thread bs28723
[via CakePHP] wrote: Did you try with session variables? Enviado desde mi iPad El 28/04/2012, a las 21:23, bs28723 < [hidden email] > escribió: I looked at routing, but I di

How can I pass parameters to controller/action not in URL?

2012-04-28 Thread bs28723
I looked at routing, but I did not see a way to solve my problem. I am looking for a way to create links to controller/actions and pass "large" or 'hidden' parameters. I could use a from and post, but seems like a lot of work for 1 or 2 links in a view. I understand the simple link call with 1

Re: Can you dynamically change CSS for a layout per user?

2012-04-28 Thread bs28723
Thanks Michael.      I think I could solve the problem of having the code in every controller by doing... class AppController extends Controller {    public function beforeRender() {             $newCss = $this->Config->getCss($username);       

Can you dynamically change CSS for a layout per user?

2012-04-28 Thread bs28723
I see in the documentation how to change the layout in the controller. I also see how to include CSS files. So, is it possible to include either inline CSS or create a temp File with CSS info that is specific to a user? For example, lets say I somehow allow user to change background and font c

Re: Understanding MVC Architecture

2012-04-24 Thread bs28723
Just to make sure I understand what you said about putting code into the models For the most part, anything that verifies, modifies, reads data from the DB should be in the model. The controller, just collects data, directs the models to read/change/update the data, then send to the view f

examples on how to create my own magic functions

2012-04-24 Thread bs28723
I tried to find the code that implements the magic functions findBy* and findAllBy* but I got lost. Can someone point me to the code or an example of how to replicate this? I may have a need to create my own set of functions like this, and would like to see how to parse the method name and then

Re: Understanding MVC Architecture

2012-04-24 Thread bs28723
Great ideas. I will see about pushing more into the models. I have not really done much with the router, but that gives me some ideas on how I can do some things. The data is fairly normalized, I am sure there is room for improvement. But it needs to scale. Basic premise is Users manage their

Re: Understanding MVC Architecture

2012-04-24 Thread bs28723
ntroller. However, I'll generally create > a controller for the other model(s), if only for admin functions. In > your case, you may have a need for an admin to create a new > OrganizationRole, for example. > > On Sun, Apr 22, 2012 at 12:45 PM, bs28723 > <[hidden email] &

Understanding MVC Architecture

2012-04-22 Thread bs28723
My question is - Is it a better MVC architecture to have a 1 to 1 relationship for a controller to access the model and the view, or since in a case where all relationships stem from a single model - just make the one controller have all the actions, but pull data from the related models needed

Re: Some Issues: multiple views on one page and help with javascript

2012-04-18 Thread bs28723
I don't know a lot about AJAX - Need to learn :-) What I am doing with the helper, is that I was finding that I was repeating code in multiple views or several times in a single view to get ready to call an element. So, I just moved this common code from the view to a helper, then made a single

Re: Some Issues: multiple views on one page and help with javascript

2012-04-17 Thread bs28723
I will try to help with the view issue. First look at the 2.x View Template section http://book.cakephp.org/2.0/en/views.html And look into Extending Views. This will allow you to break up the view. You create a frame work for a controller, then the view can have different content in the main

Progress bar for file uploads

2012-04-16 Thread bs28723
Anyone know of a good progress bar for file uploads? Don't need anything fancy, just something that gives users visual feedback that the large image file they are uploading is taking some time to transfer. Thanks, bill -- View this message in context: http://cakephp.1045679.n5.nabble.com/Pr

Re: Is this too complicated ?

2012-04-12 Thread bs28723
Was I over thinking this Maybe this simple approach would work. What if I had a table with User_id, Role_id, org_id It is setup as User hasMany Role. the Role_id is unique with the org_id. When get the user, I get an array of roles. Then when I call the Org controller, I create an isAuth

row level ACL

2012-04-12 Thread bs28723
Can any easily explain how to do row level ACL in CakePHP 2.x? I have seen some old posts on this topic, but I don't know how much has changed and would have to be redone. Any examples / tutorials would be good to. Thanks, bill -- View this message in context: http://cakephp.1045679.n5.nabb

Re: Is this too complicated ?

2012-04-10 Thread bs28723
This would be ok, if the actions were the same for each controller. But, I would like each user to have one set of actions for 1 controller and a different set for another controller. I am afraid this problem just get exponential the more users and organizations and roles there are. Just t

Is this too complicated ?

2012-04-09 Thread bs28723
I want know if this is too complicated for CakePHP / ACL / Roles or other options.. I started with a simple Organization. This Org has Roles and Users. The Organization also has things to be managed by these users, like Events, Membership Information, the Org Profile, Newsletter, etc. Fai