Raster,
Here is two patches:
- 5e2de5352-E-public-wiki-now.patch
The modification you applied on E phab installation since
commit 5e2de5352255ff1ff95ffb73ec9c11ac4e62c5cf (Mon Nov 4
08:54:00 2013 HEAD)
- a3acf5fc4-E-public-wiki-now.patch
Previous patch rebase on
commit a3acf5fc4b947a4d742d158383e348b4856f98eb (Mon Feb 10
16:13:56 2014 HEAD)
Note that your policies changes are partly applied in current HEAD since
591df78361a7 on file src/applications/files/storage/PhabricatorFile.php.
Please take me inform if you inappropriate things.
Bertrand
D'ar meurzh 11 a viz C'hwevrer 2014 e 11 eur 11, « Bertrand Jacquin » he deus
skrivet :
> D'ar meurzh 11 a viz C'hwevrer 2014 e 00 eur 26, « Carsten Haitzler » he deus
> skrivet :
> > On Mon, 10 Feb 2014 22:05:54 +0100 Bertrand Jacquin <[email protected]>
> > said:
> >
> > > Hi raster,
> > >
> > > Patches added to phab tree are present here :
> > > http://git.meleeweb.net/distros/gentoo/portage.git/tree/www-apps/phabricator/files
> > > and more precisely this one
> > > http://git.meleeweb.net/distros/gentoo/portage.git/tree/www-apps/phabricator/files/0001-Make-wiki-visible-to-all.patch
> > >
> > > All other have been handled upstream.
> > >
> > > Please send me the patch if you need add some other to be able to get
> > > upgrade done more easily and to keep track of such modifications.
> > >
> > > Thanks for this
> >
> > that patch above basically didn't work (that patch you refer to). because
> > phab
> > added a whole policy system and the wiki doesn't implement specific
> > policies. i
> > spent a lot of time learning this by poking at the code and adding
> > debugging in
> > to find how it was working. the wiki simply was not public at all until i
> > fixed
> > it yesterday. it is now.
>
> Thanks for this.
>
> > the problem is that i spent hours hacking files. i can't give you a patch
> > because i don't have an original to compare it to. i modified maybe 30 files
> > or so along the way to figuring this out. to make this work i've got maybe
> > 10
> > files changed. the installation is just a regular tree of files, i can't to
> > "git
> > diff" to get something. i don't have an original to compare against. where
> > is
> > the original phab tree BEFORE it was installed onto the server? that's what
> > i'm
> > asking. if you diff -R against that you'll get the current mods/patch set.
> > :)
>
> Ok, I didn't get that it that you changed files in place. Git tree for
> phabricator was 5e2de5352255ff1ff95ffb73ec9c11ac4e62c5cf
>
> $ bzegrep 'declare .* EGIT_VERSION='
> /var/db/pkg/www-apps/phabricator-9999/environment.bz2
>
> Installation is not handled via git directly but via portage to force us keep
> track
> of such modifications and to not lost them (another time), it maybe make
> things
> strange for you but really help when more than one person touch them.
>
> I will do a patch from your work and see if it still apply nice on more
> recent releases.
>
> Thanks for all this.
>
> > > D'ar lun 10 a viz C'hwevrer 2014 e 11 eur 32, « Carsten Haitzler » he deus
> > > skrivet :
> > > > after many hours of futzing about in phab.. i've gotten itback to where
> > > > it
> > > > once was... with a publicly readable wiki! yay! problem is - not really
> > > > possible to track changes due to the install not being a git tree.
> > > >
> > > > beber - if you have the original git tree - compare (diff -r) the tree
> > > > and
> > > > extract the changes. i can tell you the files with ~ at the end i
> > > > modified. :) but i modified them tonnes of times. i modified a tonne of
> > > > other files along the way just to find out how phab worked... so it
> > > > wasnt
> > > > sane to make a backup of every single file before i modify.
> > > >
> > > > --
> > > > ------------- Codito, ergo sum - "I code, therefore I am" --------------
> > > > The Rasterman (Carsten Haitzler) [email protected]
> > > >
> > >
> > > --
> > > Beber
> > >
> >
> >
> > --
> > ------------- Codito, ergo sum - "I code, therefore I am" --------------
> > The Rasterman (Carsten Haitzler) [email protected]
> >
>
> --
> Bertrand Jacquin
> Ingénieur technique
> Tel: +33 1 30 67 60 65
> GSM: +33 6 71 01 70 30
> http://pom-monitoring.com
> *POM Monitoring*, Pilotage de la performance du Systeme d'Information
--
Bertrand Jacquin
Ingénieur technique
Tel: +33 1 30 67 60 65
GSM: +33 6 71 01 70 30
http://pom-monitoring.com
*POM Monitoring*, Pilotage de la performance du Systeme d'Information
>From 51ce3e0af91fd18f678baca1b4064a86ab944590 Mon Sep 17 00:00:00 2001
From: Carsten Haitzler <[email protected]>
Date: Mon, 10 Feb 2014 19:32:45 +0900
Subject: [PATCH] E: public wiki now
after many hours of futzing about in phab.. i've gotten itback to where it once
was... with a publicly readable wiki! yay! problem is - not really possible to
track changes due to the install not being a git tree.
---
.../base/controller/PhabricatorController.php | 2 +-
.../countdown/storage/PhabricatorCountdown.php | 2 +-
src/applications/files/storage/PhabricatorFile.php | 4 ++++
.../maniphest/query/ManiphestTaskSearchEngine.php | 3 ++-
.../phriction/controller/PhrictionController.php | 19 ++++++++++++-------
.../controller/PhrictionDocumentController.php | 15 +++++++++++----
.../phriction/storage/PhrictionDocument.php | 5 ++++-
7 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php
index 149f40e..dd97fc3 100644
--- a/src/applications/base/controller/PhabricatorController.php
+++ b/src/applications/base/controller/PhabricatorController.php
@@ -5,7 +5,7 @@ abstract class PhabricatorController extends AphrontController {
private $handles;
public function shouldRequireLogin() {
- return true;
+ return false;
}
public function shouldRequireAdmin() {
diff --git a/src/applications/countdown/storage/PhabricatorCountdown.php b/src/applications/countdown/storage/PhabricatorCountdown.php
index b69a9d5..dc19ec5 100644
--- a/src/applications/countdown/storage/PhabricatorCountdown.php
+++ b/src/applications/countdown/storage/PhabricatorCountdown.php
@@ -49,7 +49,7 @@ final class PhabricatorCountdown
public function getPolicy($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
- return $this->getViewPolicy();
+ return PhabricatorPolicies::POLICY_PUBLIC;
case PhabricatorPolicyCapability::CAN_EDIT:
return PhabricatorPolicies::POLICY_NOONE;
}
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
index c54e079..8c57c1d 100644
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -877,6 +877,10 @@ final class PhabricatorFile extends PhabricatorFileDAO
}
public function getPolicy($capability) {
+ switch ($capability) {
+ case PhabricatorPolicyCapability::CAN_VIEW:
+ return PhabricatorPolicies::POLICY_PUBLIC;
+ }
// TODO: Implement proper per-object policies.
return PhabricatorPolicies::POLICY_USER;
}
diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
index 1a793e9..fbb3593 100644
--- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
+++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
@@ -359,12 +359,13 @@ final class ManiphestTaskSearchEngine
public function getBuiltinQueryNames() {
$names = array();
+ $names['open'] = pht('Open Tasks');
+
if ($this->requireViewer()->isLoggedIn()) {
$names['assigned'] = pht('Assigned');
$names['authored'] = pht('Authored');
}
- $names['open'] = pht('Open Tasks');
$names['all'] = pht('All Tasks');
return $names;
diff --git a/src/applications/phriction/controller/PhrictionController.php b/src/applications/phriction/controller/PhrictionController.php
index c8d93ff..591bd7f 100644
--- a/src/applications/phriction/controller/PhrictionController.php
+++ b/src/applications/phriction/controller/PhrictionController.php
@@ -12,7 +12,9 @@ abstract class PhrictionController extends PhabricatorController {
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($for_app) {
- $nav->addFilter('create', pht('New Document'));
+ if ($user->isLoggedIn()) {
+ $nav->addFilter('create', pht('New Document'));
+ }
$nav->addFilter('/phriction/', pht('Index'));
}
@@ -31,6 +33,7 @@ abstract class PhrictionController extends PhabricatorController {
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
+ $user = $this->getRequest()->getUser();
if (get_class($this) != 'PhrictionListController') {
$crumbs->addAction(
@@ -40,12 +43,14 @@ abstract class PhrictionController extends PhabricatorController {
->setIcon('transcript'));
}
- $crumbs->addAction(
- id(new PHUIListItemView())
- ->setName(pht('New Document'))
- ->setHref('/phriction/new/?slug='.$this->getDocumentSlug())
- ->setWorkflow(true)
- ->setIcon('create'));
+ if ($user->isLoggedIn()) {
+ $crumbs->addAction(
+ id(new PHUIListItemView())
+ ->setName(pht('New Document'))
+ ->setHref('/phriction/new/?slug='.$this->getDocumentSlug())
+ ->setWorkflow(true)
+ ->setIcon('create'));
+ }
return $crumbs;
}
diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php
index 9f5f560..ae5f9fb 100644
--- a/src/applications/phriction/controller/PhrictionDocumentController.php
+++ b/src/applications/phriction/controller/PhrictionDocumentController.php
@@ -273,20 +273,25 @@ final class PhrictionDocumentController
->setUser($user)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($document);
+ if (!$user->isLoggedIn()) {
+ return $action_view;
+ }
if (!$document->getID()) {
return $action_view->addAction(
id(new PhabricatorActionView())
->setName(pht('Create This Document'))
->setIcon('create')
- ->setHref('/phriction/edit/?slug='.$slug));
+ ->setHref('/phriction/edit/?slug='.$slug)
+ ->setDisabled(!$can_edit));
}
$action_view->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Document'))
->setIcon('edit')
- ->setHref('/phriction/edit/'.$document->getID().'/'));
+ ->setHref('/phriction/edit/'.$document->getID().'/')
+ ->setDisabled(!$can_edit));
if ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) {
$action_view->addAction(
@@ -294,14 +299,16 @@ final class PhrictionDocumentController
->setName(pht('Move Document'))
->setIcon('move')
->setHref('/phriction/move/'.$document->getID().'/')
- ->setWorkflow(true));
+ ->setWorkflow(true)
+ ->setDisabled(!$can_edit));
$action_view->addAction(
id(new PhabricatorActionView())
->setName(pht('Delete Document'))
->setIcon('delete')
->setHref('/phriction/delete/'.$document->getID().'/')
- ->setWorkflow(true));
+ ->setWorkflow(true)
+ ->setDisabled(!$can_edit));
}
return
diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php
index 3e36a26..35d4533 100644
--- a/src/applications/phriction/storage/PhrictionDocument.php
+++ b/src/applications/phriction/storage/PhrictionDocument.php
@@ -112,10 +112,13 @@ final class PhrictionDocument extends PhrictionDAO
}
public function getPolicy($capability) {
+ switch ($capability) {
+ case PhabricatorPolicyCapability::CAN_VIEW:
+ return PhabricatorPolicies::POLICY_PUBLIC;
+ }
if ($this->hasProject()) {
return $this->getProject()->getPolicy($capability);
}
- return PhabricatorPolicies::POLICY_USER;
}
public function hasAutomaticCapability($capability, PhabricatorUser $user) {
>From 2ecac475de735b5112c60f7fcea7d179523d81d3 Mon Sep 17 00:00:00 2001
From: Carsten Haitzler <[email protected]>
Date: Mon, 10 Feb 2014 19:32:45 +0900
Subject: [PATCH] E: public wiki now
after many hours of futzing about in phab.. i've gotten itback to where it once
was... with a publicly readable wiki! yay! problem is - not really possible to
track changes due to the install not being a git tree.
---
.../base/controller/PhabricatorController.php | 2 +-
.../countdown/storage/PhabricatorCountdown.php | 2 +-
src/applications/files/storage/PhabricatorFile.php | 2 +-
.../maniphest/query/ManiphestTaskSearchEngine.php | 3 ++-
.../phriction/controller/PhrictionController.php | 19 ++++++++++++-------
.../controller/PhrictionDocumentController.php | 15 +++++++++++----
.../phriction/storage/PhrictionDocument.php | 5 ++++-
7 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php
index eb31ff9..a8fb8bf 100644
--- a/src/applications/base/controller/PhabricatorController.php
+++ b/src/applications/base/controller/PhabricatorController.php
@@ -5,7 +5,7 @@ abstract class PhabricatorController extends AphrontController {
private $handles;
public function shouldRequireLogin() {
- return true;
+ return false;
}
public function shouldRequireAdmin() {
diff --git a/src/applications/countdown/storage/PhabricatorCountdown.php b/src/applications/countdown/storage/PhabricatorCountdown.php
index b69a9d5..dc19ec5 100644
--- a/src/applications/countdown/storage/PhabricatorCountdown.php
+++ b/src/applications/countdown/storage/PhabricatorCountdown.php
@@ -49,7 +49,7 @@ final class PhabricatorCountdown
public function getPolicy($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
- return $this->getViewPolicy();
+ return PhabricatorPolicies::POLICY_PUBLIC;
case PhabricatorPolicyCapability::CAN_EDIT:
return PhabricatorPolicies::POLICY_NOONE;
}
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
index dc6ad6d..47594cc 100644
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -887,7 +887,7 @@ final class PhabricatorFile extends PhabricatorFileDAO
public function getPolicy($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
- return $this->getViewPolicy();
+ return PhabricatorPolicies::POLICY_PUBLIC;
case PhabricatorPolicyCapability::CAN_EDIT:
return PhabricatorPolicies::POLICY_NOONE;
}
diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
index 401bff0..8eb2b63 100644
--- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
+++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
@@ -359,13 +359,14 @@ final class ManiphestTaskSearchEngine
public function getBuiltinQueryNames() {
$names = array();
+ $names['open'] = pht('Open Tasks');
+
if ($this->requireViewer()->isLoggedIn()) {
$names['assigned'] = pht('Assigned');
$names['authored'] = pht('Authored');
$names['subscribed'] = pht('Subscribed');
}
- $names['open'] = pht('Open Tasks');
$names['all'] = pht('All Tasks');
return $names;
diff --git a/src/applications/phriction/controller/PhrictionController.php b/src/applications/phriction/controller/PhrictionController.php
index c8d93ff..591bd7f 100644
--- a/src/applications/phriction/controller/PhrictionController.php
+++ b/src/applications/phriction/controller/PhrictionController.php
@@ -12,7 +12,9 @@ abstract class PhrictionController extends PhabricatorController {
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($for_app) {
- $nav->addFilter('create', pht('New Document'));
+ if ($user->isLoggedIn()) {
+ $nav->addFilter('create', pht('New Document'));
+ }
$nav->addFilter('/phriction/', pht('Index'));
}
@@ -31,6 +33,7 @@ abstract class PhrictionController extends PhabricatorController {
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
+ $user = $this->getRequest()->getUser();
if (get_class($this) != 'PhrictionListController') {
$crumbs->addAction(
@@ -40,12 +43,14 @@ abstract class PhrictionController extends PhabricatorController {
->setIcon('transcript'));
}
- $crumbs->addAction(
- id(new PHUIListItemView())
- ->setName(pht('New Document'))
- ->setHref('/phriction/new/?slug='.$this->getDocumentSlug())
- ->setWorkflow(true)
- ->setIcon('create'));
+ if ($user->isLoggedIn()) {
+ $crumbs->addAction(
+ id(new PHUIListItemView())
+ ->setName(pht('New Document'))
+ ->setHref('/phriction/new/?slug='.$this->getDocumentSlug())
+ ->setWorkflow(true)
+ ->setIcon('create'));
+ }
return $crumbs;
}
diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php
index d5aa4a7..be3b067 100644
--- a/src/applications/phriction/controller/PhrictionDocumentController.php
+++ b/src/applications/phriction/controller/PhrictionDocumentController.php
@@ -277,20 +277,25 @@ final class PhrictionDocumentController
->setUser($user)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($document);
+ if (!$user->isLoggedIn()) {
+ return $action_view;
+ }
if (!$document->getID()) {
return $action_view->addAction(
id(new PhabricatorActionView())
->setName(pht('Create This Document'))
->setIcon('create')
- ->setHref('/phriction/edit/?slug='.$slug));
+ ->setHref('/phriction/edit/?slug='.$slug)
+ ->setDisabled(!$can_edit));
}
$action_view->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Document'))
->setIcon('edit')
- ->setHref('/phriction/edit/'.$document->getID().'/'));
+ ->setHref('/phriction/edit/'.$document->getID().'/')
+ ->setDisabled(!$can_edit));
if ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) {
$action_view->addAction(
@@ -298,14 +303,16 @@ final class PhrictionDocumentController
->setName(pht('Move Document'))
->setIcon('move')
->setHref('/phriction/move/'.$document->getID().'/')
- ->setWorkflow(true));
+ ->setWorkflow(true)
+ ->setDisabled(!$can_edit));
$action_view->addAction(
id(new PhabricatorActionView())
->setName(pht('Delete Document'))
->setIcon('delete')
->setHref('/phriction/delete/'.$document->getID().'/')
- ->setWorkflow(true));
+ ->setWorkflow(true)
+ ->setDisabled(!$can_edit));
}
return
diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php
index 6cb0658..550393d 100644
--- a/src/applications/phriction/storage/PhrictionDocument.php
+++ b/src/applications/phriction/storage/PhrictionDocument.php
@@ -116,10 +116,13 @@ final class PhrictionDocument extends PhrictionDAO
}
public function getPolicy($capability) {
+ switch ($capability) {
+ case PhabricatorPolicyCapability::CAN_VIEW:
+ return PhabricatorPolicies::POLICY_PUBLIC;
+ }
if ($this->hasProject()) {
return $this->getProject()->getPolicy($capability);
}
- return PhabricatorPolicies::POLICY_USER;
}
public function hasAutomaticCapability($capability, PhabricatorUser $user) {
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel