the User model is not directly associated to Articles, but
via the Author model.
Articles have a foreign "author_id", same does the User model.
When i add an association in the Article model between User and
Article like this:
(i could do this on the fly with bind model also)
'U
here's the crucial part of the sql generated:
...
FROM `articles` AS `Article`
LEFT JOIN `authors` AS `Author` ON `Article`.`author_id` =
`Author`.`id`
LEFT JOIN `users` AS `somestring` ON `Article`.`user_id` =
`somestring`.`id`
...
the problem is that `Article`.`user_id` doesn't exist..
-
l sits *in between* Article and User...
Obviously the User model is not present.
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@g
ive = 1;
$sortby = array("Article.created" => "DESC");
$article_list = $this->Article->findAll($conditions, null, $sortby);
I know i can get this running, but i'm stuck here.
Do i have to bind the User model at all ? (since it *is* already
associated->as
#x27;Article']['Article.remark'] = "!=''";
is converted into
select * from articles where fotohinweis != '\"\"'
which gives *all* articles, because it searches for \"\"
any ideas ?
thanks, jyrgen
--~--~-~--~~~--
Geoff, thanks for your response.
My setup is this:
webserver docroot
/
index.php
then
/app
-config/
-models etc..
-webroot
/cake
(the core stuff)
a standard installation. otherwise i would have mentioned.
i have no access to httpd.conf, (shared environment)
--~--~-~--~
tive
needs different parameters for the three .htacces files.
also this happens on a live production server, where i don't want
to twiggle around and get stuck.
can someone point me to a solution for this ?
thanks , jyrgen
--~--~-~--~~~---~--~~
You received this m
On 29 Jun., 19:44, francky06l <[EMAIL PROTECTED]> wrote:
> $this->name in view.
>
that's the controller name :-(
thanks anyways, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "
myview");
in other words: how can i distiguish between different views
rendered in a single action.
i pr'd $this->controller and $this->View, but the view rendered didn't
show up.
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message b
sider increasing the gc probability). check then
if the session table has been emptied.
i don't quite believe that gc is not happening on your site.
but make sure it is before diving deeper into the session mechanism.
best, jyrgen
--~--~-~--~~~---~--~~
You rec
,100);
will set the garbage collection probability to 1/100
cheers, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
ndering how to hide the "alpha" version from normal
users... Should i employ an auth mechanism or can i utilize .htaccess
files ?
Maybe the subdomain approach is better ? (which is running nicely
in conjunction with my admin pages)
(i have no access to ap
hi again,
how can i set up different validation rules (for a model) for
different user types ?
for example the regular web user *must* enter his phone number when
registering,
while the backend admin may create records that just contain the last
name.
thanks a lot.
jyrgen
hi !
i have no idea what you want to achieve. please
put your question in clearer words .
Generally avoid hassling around with the rewrite
rules, in most cases you don't have to modify the
.htaccess files. check out cake's routing feature.
che
, but
you have to set it up manually.
good luck and let us know how you did it
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegro
aybe. but it's
definitely a means to overcome session data encryption...
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@go
time?
here i disagree. it's less effort to:
$this->Session->write('User.logged_in', 1);
upon successful login.
and
if($this->Session->readSessionVar('User.logged_in') == 1){
in beforeFilter in app_controller.php
best, jyrgen
--~--~-~--~-
This is my solution for prevention of multiple logins
with grigri's helper function.
have fun , jyrgen
users_controller.php
...
// ... password validation succeeded
...
// custom session garbage collection
//
$sessions = $this->Mysession->findAll();
foreach($sessions
em.
check the cookie information in your browser:
expiration, path and so on.
did you set up any fancy routings ? admin routing ?
admin on a subdomain...
hope this helps.
ps: check your php session settings as well
cheers, jyrgen
--~--~-~--~~~---~--~~
You rec
beatiful :-)
thanks very much !
cheers, jyrgen
On 16 Mai, 16:56, grigri <[EMAIL PROTECTED]> wrote:
> Nice and simple solution:
>
> function decode_session_data($encoded) {
> $backup = $_SESSION;
> $_SESSION = array();
> session_decode($encoded);
> $ret
beautiful !
so this is the meaning of "transparent encryption" from the
suhosin "hardening" feature list...
thanks ! jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP"
owers the site security, but for now i can live with this.
best, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To u
> > * prevention of multiple logins *
>
> You want only one person to be logged in at a time OR you don't want
> the same person to login from multiple computers at the same time?
sorry, this was ambigous...
the latter, one person may login only on
le logins *
(which i assumed being an easy task to achieve :-)
in fact i like soytuny's idea...
cheers, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, sen
> Why not just register a session handling function to do that?
because i don't want to mess / overwrite / interfere with cake's gc,
which is just doing fine.
i need to collect garbage only once, before someone attempts
to login. by means of this i make sure that compare only against
active acc
> PHP sessions are managed by a garbage-collection routine and have
> expiration times.
thanks, yes i know. i do collect garbage "manually" by deleting
expired rows from the session table (before the login).
please don't get me wrong. i worked all this out, and it was running
until my provider i
yeah, you're right. I could set up an extra table for this, or
add an extra column to the user record. but when a session
is not closed properly, the login value remains 1.
> You definitely could...but then you have to make sure you delete old
> records so that you don't record someone as being
hm. do you mean i should rather store the login state
somewhere else, in another table... ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroup
wice
hm... don't you agree ??
What can you see, when you evaluate $_SESSION ?
Or $this->session in cake ? You see the session of the
current user, but not the login state of *all* users.
jyrgen
On 15 Mai, 22:17, MrTufty <[EMAIL PROTECTED]> wrote:
> Jyrgen,
>
> I stil
> Sorry you feel differently. If you have the source, you should be
> able to figure it out.
c'mon that's really kiddy stuff. i'm talking about software design,
and i would like to know why this or that has been implemented.
if you would point every user to the sources, what's the use of
this g
> So why don't you go into the source of CakePHP and look at the code?
guess what i did... i found... nothing which helped me any further.
thats why i posted this problem again ,
but thanks, anyway (not ironic)
--~--~-~--~~~---~--~~
You received this message beca
thanks Matt,
generally i don't post anything here before looking in to source.
ok, so what do we find in the session lib:
the database read function :
function __read($key) {
$db =& ConnectionManager::getDataSource('default');
$table = $db->fullTableName
> Wouldn't it better for you to learn how it works instead of someone
> just spoon-feeding you an answer?
now that's a great help ! :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to t
i wished that phpnut or any other guy who wrote this lib
could be pointed to this thread... :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@google
does that mean that my hosting provider activated the
suhosin patch ? that would explain it.
can i decrypt the data manually ?
> Suhosin or a similar PHP-securing extension that auto-encrypts Session
> and Cookie vars, maybe?
>
> -Matt
--~--~-~--~~~---~--~~
You r
> Why can't you set a cookie? Way easier.
how do you mean ?
cookies are activated. please explain
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@goo
> Again, why are you trying to read entries from the session table?
in the session i store the user ID, as well as a flag
"logged_in" (equals
0 or 1). so i can test in my actions if the user is authenticated.
does that make sense ?
now imagine another user with the account data (doesn't matter
i get a php error, of course, the format is not accepted,
Notice: unserialize(): Error at offset 0 of 117 bytes in /var/www/cake/
app/views...
how does cake do it ? this is what i just don't get into my head,
since the
session lib is able to read and write values from / to the db
--~--
i don't think i need a custom session handler.
cake's session component *is* such a handler.
i just want to get the data column deserialized, thats all.
but it seems impossible with this format i find in the db.
for example where does the " | " sign come from ??
--~--~-~--~~-
i need access to *all* existing valid sessions in the table,
so i can test, if a user is already logged in .
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cak
179247983;s:
9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}
php fails to unserialize this string !!
thats why i cannot read entries from the session table.
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
why can't i simply use php's (un)serialize in order to get
data out of the session table ?
i might be wrong but i expected this to work, since php
internal serialize handling is activated:
ini_set('session.serialize_handler',
the aforementioned problem went away after one hour or so.
perhaps i should consider changing my hosting provider ..
thanks for looking over this :-)
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
7;, '1179180222', 'htgs5384dsj4hets481tmhfba4')
are the session data corrupted or is this a encryption feature ?
what's going on ?
can somebody at least point to a method where i can start debugging ?
any help is appreciated !
thanks again,
jyrgen
--~--~-~-
27;7YDr60NnYV1R2asLTAPMDb-
q3OO1lqf22IDYuIJBAswmyfMyO2Y3oYFdi3TGWsqh1hPFh4XWN0aEQNQFmIhGuRtpqDmpZ8Fm
do you know where this comes from ?
please help,
thx
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to
install another app, besides
the cake app, but as soon as i try to access that second app,
i get missing controller errors, auth problems and such.
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "
t that the community will grow
far beyond 1000 Users. The mailer will of course not send 1000 emails
at once.
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this
by means of admin routing you can for example put all your backend
actions
into a subdomain (http://admin.yoursite.com)
http://bakery.cakephp.org/articles/view/hosting-admin-urls-on-a-subdomain
cheers, jyrgen
--~--~-~--~~~---~--~~
You received this message
chris,
if i had the choice i would go for Majordomo or another
decent list manager. But i have to deal with shared
hosting.
i'll check out phplist and see if i can integrate it into
the framework.
cheers, jyrgen
--~--~-~--~~~---~--~~
You received this me
i'm talking about a n e w s l e t t e r. (see above ! )
don't mix that up with spam.
> I've tried to stay away from building spam components, hurts my
> reputation on the streets.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
sorry, my question is not so much cake related.
i mean a mass mail mechanism which integrates with the
cake architecture esp. class_phpmailer.php
in the meantime i found phplist, if you have any experiences
with this, please let me know.
--~--~-~--~~~---~--~~
Yo
has anybody implemented a newsletter component or plugin ?
couldn't find anything here as well as in the bakery .
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
have more than 1000 lines of code, but
would you call that "fat" ? it also depends on how many actions
(frontend as well as admin) one invents
cheers,
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
i forgot to mention that the live pages are still
protected via a htgroup file in /.
It contains Login and password, no paths.
But could it possible interfere with the session cookie
path ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed
ickn dirty hack in the
session lib by forcing
ini_set('session.cookie_path', $this->path);
to
ini_set('session.cookie_path', "/");
unless you have a better idea ;-)
thanks !
jyrgen
ps. : i've described the problem in
http://groups.google.ch/group/cake-php/b
,
and proceed to the app.
the situation on my development machine (localhost) is different
though.
here everythings works nicely, the session path is /cake/ (doc root
relative
to my app)
hope you can help,
thanks jyrgen
--~--~-~--~~~---~--~~
You received this me
e, part of your view as well as your action
code, otherwise debugging is almost impossible, at least for me :-)
cheers, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to
anks a lot , jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECT
, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For mo
more...
http://groups.google.ch/group/cake-php/browse_thread/thread/9d1ebcc2d01d75c3/9370d56570cb5347
maybe your can answer there.
thanks a bunch, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "C
ller dump
the controller name is "Users" and not "Adminusers"
what can i do ?
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, sen
ation of controller names take place? It seems
obvious that
the subdomain string is taken into account here.
thank you so much !
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To p
uld be Users Controller and so on...
see this thread:
http://groups.google.ch/group/cake-php/browse_thread/thread/ecddc4832edc3d6a/430b62f0e4b3b4e3
and this:
http://groups.google.ch/group/cake-php/browse_thread/thread/45a30f85c8ab163f/8c
On 15 Apr., 10:25, "sumanpaul" <[EMAIL PROTECTED]> wrote:
> ahh is your mod_rewrite enabled?
in apache conf yes. but i've commented out the .htaccess files.
is mod_rewrite neccessary for creating static links ??
cheers, jyrgen
--~--~-~--~~-
> echo $html->link('File','http://host.com/files/quickguide.pdf');
no, i get a "not found" error. But the pdf is there.
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
;APP_DIR', 'app');
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__FILE__)); // this dir !
define('WEBROOT_DIR', 'webroot');
define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS); //
app-dir / webroot
with my routing ?
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED
will be placed online
(in the www root dir).
any more ideas ?
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
To un
hi all,
i am wondering how to create static links with the link helper
(for example to a pdf) and where to put the files.
$html->link always renders http://host/cake/index.php/controller/action
which i don't want in this case.
thank you
on.gc_probability",1);
ini_set("session.gc_divisor",100);
respectively.
at least on my ubuntu i couldn't find any cron jobs which interfere
with cake's database driven session handling.
cheers, jyrgen
--~--~-~--~~~---~--~~
You received
.
why experimenting with probability ? why random ?
hm..
jyrgen
> function __close() {
> $probability = mt_rand(1, 150);
> if($probability <= 3) {
> $this->__gc();
> }
&g
e sessions ?
can you read the usernames from another table, which is
related to the session entry ?
i would have been better of storing the logged_in status in another
table... but anyways, it works for now...
regards, jyrgen
--~--~-~--~~~---~--~~
You receiv
ions as $session){
if($session['Mysession']['expires']Mysession->del($session['Mysession']['id']);
}
}
use the mysession model i posted above.
majna, wasn't it this what you have been looking for ?
cheers, jyrgen
--~--~-
s[$a[$i]] = unserialize( $a[$i+1] );
}
}
should be combined with a session model in order to
avoid explicit sql quering.
i can live with that :-)
still searching for a method to collect session garbage.
once i got this done, multiple logins are prevented and
my auth syste
oops. i just noticed that the Session model interferes
with the Session object.
therefore i renamed the Session model into
mysession.php
class Mysession extends AppModel{
var $name = 'Mysession';
var $useTable = 'sessions';
}
j.
--~--~-~--~~~--
lers/users_controller.php on line 88
with 117 being the last position "}" of the serialized string
Config|a:3:{s:4:"rand";i:1024300043;s:4:"time";i:1175942427;s:
9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}
thanks for your help!
jyrgen
flash itself won't redirect.
$this->Session->setFlash('Invalid id for Article.');
$this->redirect('/articles/search');
works for me.
paste some code.
cheers, jyrgen
--~--~-~--~~~---~--~~
You received this message becaus
e logins. this would help me a lot to get started.
maybe othauth has such a feature, i'll have a look at it...
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this gr
> Ah, I understand. Perhaps the easiest way to solve this problem is to
> create a custom session handler that uses the login ID as the key for
> the session. You can't have more than one session with the same login
> ID that way, so that stops multiple logins.
what do you mean exactly by custo
bability to 1 to achieve this, but
i dislike the idea...
anyways, apart from read/write to the current session there
seems to be no other routines out of the box for my needs.
thats why i considered setting up a model for the session
table. but when it
_read work:
3) how does the actual (de)serialization happen in
class CakeSession ?
thanks, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send e
e i had to search all existing session entries in the db for
a userID and the logged_in flag.
the code i posted is ugly, i looked at /lib/session.php twice but i
was not
able to determine how cake unserializes the session vars.
still i'm looking for a better
x27;data'], -1,
PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
for( $i = 0; $i < count( $a ); $i = $i+2 ) {
$variables[$a[$i]] = unserialize( $a[$i+1] );
}
}
pr($variables);
cheers, jyrgen
--~--~-~--~~~---~--~
s for your help
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROT
thanks jon, we crossposted.
i'll remove the association array from the lookup model,
it is not needed there, you're right.
j.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group
"articlesright.php" -> "articles_right.php"
i can't believe it, i got it running !
thanks a ton guys esp. for your patience :-))
i'd suggest to include this solution into the faq, if you're
still gathering useful techniques..
'finderQuery' => '',
'deleteQuery' => '',
),
);
}
###
and the framework complains :
Fatal error: Cannot instantiate no
i'm getting this error:
Fatal error: Cannot instantiate non-existent class: tagassociationa
in /var/www/cake/cake/libs/model/model_php4.php on line 445
J
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP"
sorry for insisting, but it is still not clear for me, after i did
some testing.
do i have to create a model file for each association ?
or does your code create the assiociations dynamically ?
thanks again, jyrgen
--~--~-~--~~~---~--~~
You received this
Can somebody please explain the model definitions of TagAssociation ?
Are they bare ?
J
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.
thanks jon,
a more simple (silly?) question about TagAssociationA and
TagAssociationB resp.
did i get you right that they are identical but just carry different
names in order
to get sql set up ?
thx, j
--~--~-~--~~~---~--~~
You received this message because
could you please give an example, maybe according to the one
in the thread i mentioned above, this one:
> Working E.g.
> $this->Post->bindModel(array('hasOne'=>array('PostsTag'=>array(;
> $constraint['Post.published'] = '< '.date('Y-m-d H:i:s');
> $constraint['PostsTag.tag_id'] = $tagId; // o
sure, it won't make sense to bind a model for each value...
so what remains is to build the query manually. hm actually
i want to avoid this, since the query is already quite complex.
hmm... let me rethink this. maybe i missed sth, because i'm
wondering that apparently nobody ever came across th
> an AND is illogical - the field in A row in the database can only have
> ONE value.
i see... how would i find posts containing both tags "foo" and "bar" ?
this appears to be a rather common query to me.
jyrgen
--~--~-~--~~~---~--~~
and" => array(1,2));
with the same result.
and this:
$conditions['ArticlesRight']['right_id'] = Array("and" =>
array("ArticlesRight" => Array("right_id" => 1, "right_id" => 2)));
wh
on different machines.
> ini_set("session.gc_divisor",100);
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.
0
the only remarkable difference is the dc_divisor...
hm... any ideas ?
jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.co
rther here..
thanks again, jyrgen
ps. can somebody of the developer guys (nate?) make it clearer ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-
i will try to set gc_divisor and gc_maxlifetime in the
session constructor... and see what happens...
thank you very much
jyrgen
>
> session cleaning depends on these php settings:
> session.gc_probability, session.gc_divisor and session.gc_maxlifetime.
> As far as I can tell,
by the cake session class, and has to be adjusted
manually ?
thx, jyrgen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
1 - 100 of 174 matches
Mail list logo