-
Posts
212 -
Joined
-
Last visited
Posts posted by Manaus
-
-
Thanks Soma and Pierre-Luc,
The query roles=utente, roles!=superuser|guest returns an empty array, I need to keep users having guest+utente, and exclude users who have utente+admin role (I don't think changing the password to a guest bears consequences, does it?)
-
Hello,
I have a list where users can have two or more roles: guest+utente, guest+utente+superuser, guest
I need to find all users having 'utente' as role, but not admin, nor guest.
Tried this
$u = $users->find("roles*=utente"); $u = $users->find("roles=utente")->not("roles=superuser")->not("roles=guest"); $u = $users->find("roles!=superuser")->find("roles=utente");
But without success..
Thanks for any suggestion
-
Hello, I'm trying to hack this thing, witout success...
echo $page->documents; // selfie.jpg echo $page->documents->description; // no echo $page->documents->get("description"); // no $f = $fields->get("documents"); echo $f->description; // neither
Thanks for any suggestion...
-
Hello,
I'm trying to create a Page with a uploaded file.
What I'm wondering is Do I have to create the Page first, save, then add the file?
Or can I create the page, add the file then save?
Just to understand the Cms logic...
Thanks!!!
-
Hello,
I need to add the guest role to so many users I just added [using a csv] to $users pool, is there any way to make it from the backend?
I'm also trying to code it, but I don't know how to make up the selector
$usersWithoutRole = $users->find("roles*=gooduser,roles!*=guest, roles!=superuser")
Thanks
-
Hello,
I need to send the password to the $user, but $user->password returns blank. Is this a security concern? Should I use the tmp_pass workaround?
Thanks
-
Sorry, dumb/newbie question,
I can't find how to use this module, should I rename all the templates to .twig and put the logic (selectors, expressions) between <?php ?> tags?
Thanks in advance
-
Hello,
I've seen from different forum posts that the password field is never sanitized. Isn't it subject to malicious code?
Thanks!
-
Hello,
I have a form where there are many input[text] and one input{file/image}. How can I check whether the file/image was submitted, since it doesn't show up in the POST array?
Thanks!
-
Hello, I have a page with this code
if ($input->get->progetto && $input->get->item) { $prg = (int) $input->get->progetto; $itm = (int) $input->get->item; $theitem = $pages->get($itm); echo $theitem->createdUser == $user; // prints nothing if ($user->isSuperuser() || $theitem->createdUser == $user) { $theitem->delete(); } $projurl = $pages->get($prj)->url; $session->redirect($projurl); }
I get this error: "Error: Exception: This page may not be deleted (in /Users/utente/Sites/gammapw/wire/core/Pages.php line 847)"
Still, the removing action takes place.
Any suggestion?
Thanks!
-
Hello,
I'm releasing an app into the wilderness, so I need to know about errors asap. Is there any code/module to mail the admin when an error/exception occurs?
Thank you very much
-
Thanks Horst and Soma, now working!!!
-
Thanks Horst,
looks like one, but it's actually L..
-
2
-
-
Hello,
I have a form submitting some values, but I get a strange behaviour. Just after submitting, I cannot see the delete button. It's visibile when loading the page normally though (GET, !POST).
echo $user." ".$l->createdUser; // always matches if ($user->isSuperuser() or $user === $l->createdUser) { echo "<a href='{$_root}delete-item/?proj=$page->id&item=$l->id'>Delete</a>"; // sometimes visibile, sometimes not }
These are my attempts
echo (int) $user == $l->createdUser; // always true, even if values don't match echo (int) $user == (int) $l->createdUser; // always true, even if values don't match echo (int) $user === (int) $l->createdUser; // always true, even if values don't match echo (int) $user->id === (int) $l->createdUser; // never true echo $user == $l->createdUser; // usually works correctly, but not just after $user posted something echo $user === $l->createdUser; // same as previous
Thanks for any suggestion
-
Great Adrian, thanks!!
[removed dumb question :]
-
Wonderful work,
the admin side looks so snappy now
-
1
-
-
Thanks Adrian,
but how do I define 'new articles'? The user should see only those published between his last visit and now... is there any $user->lastLogin() ?
-
Hello,
I need to show only new articles to logged in users, I believe it's done with cookies, but really can't figure out how to proceed..
Any suggestion?
Thanks!
-
Thanks Ryan it worked very well
-
Thanks Wanze it worked!!
-
Hello,
I'm trying to display the just uploaded image on the page, but I can't make it work.
This is the code
<img src='<?= $user->avatar->last->getThumb('thumbnail') ?>' alt='' />
I get a Call to a member function getThumb() on a non-object error.
Still the image is uploaded correctly, as I can see from the admin...
Instead if I load the page as a usual Get, I can see the image correctly.
This is the code I use for uploading the image...
$user->of(false); $user->avatar->deleteAll(); $a = new WireUpload('avatar'); $a->setMaxFiles(1); $a->setOverwrite(true); $a->setDestinationPath($user->avatar->path()); $a->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); foreach ($a->execute() as $files) { $user->avatar->add($files); } $user->save(); $user->of(true);
Thanks for any suggestion
-
Hello, I have a page with multiple checkboxes, each enables or disables (or should) a Page value in a template... the Page value represents $users linked to that specific page.
I have this code:
$d = $input->post->recipients; // array of values, such as rec[1010]=>true, rec[1024]=>true $c->of(false); // $c is the page foreach ($d as $dest) { $c->recipients->set($dest, true); // recipients is the Page field in the template } $c->save(); $c->of(true);
Still I have it not working,
Thanks for any suggestion..!
-
Hello, I have this code
$a = new WireUpload('documents'); $a->setMaxFiles(10); $a->setOverwrite(false); $a->setDestinationPath($c->documents->path()); $a->setValidExtensions(array('jpg','jpeg','png','gif','doc','docx','xls','xlsx','pdf')); $c->of(false); foreach ($a->execute() as $files) { $c->documents->add($files); } $c->save(); $c->of(true);
but I manage to save only one file...
I put the multiple="multiple" attribute on the file input.Any suggestion?
Thanks!...
-
Hi,
I'm having an error "Method Page::template does not exist or is not callable in this context" because I'm using {% if page.template == "project" %} in a template.
I'm passing $twigvars = array("page" => $page) to the template.
Is there any workaround for getting this conditional on a template? (started learning twig yesterday...
Thanks!
Finding users by not roles
in General Support
Posted
Thanks guys,
sorry, late night, slow thinking