More fixes for migration, in particular for setting policies on projects and tasks.
This commit is contained in:
@@ -27,7 +27,7 @@ require_once 'storage.php';
|
||||
$res = db_query_params ('SELECT user_id,user_pw,user_name,realname,email,add_date,timezone FROM users WHERE status=$1 ORDER BY user_id', array('A'));
|
||||
|
||||
$user_ids = &util_result_column_to_array ($res, "user_id");
|
||||
$user_pws = &util_result_column_to_array ($res, "user_pws");
|
||||
$user_pws = &util_result_column_to_array ($res, "user_pw");
|
||||
$user_names = &util_result_column_to_array ($res, "user_name");
|
||||
$user_realnames = &util_result_column_to_array ($res, "realname");
|
||||
$user_emails = &util_result_column_to_array ($res, "email");
|
||||
|
||||
@@ -7,10 +7,14 @@ require_once 'storage.php';
|
||||
require_once 'adapt.php';
|
||||
require_once 'phab.php';
|
||||
|
||||
/* user groups */
|
||||
$all_developers = array_merge(array_merge($bf_developers, $addon_developers), $translation_developers);
|
||||
create_project("Moderators", "None", true, $all_developers, "Users with more edit capabilities.", true);
|
||||
|
||||
/* projects */
|
||||
create_project("BF Blender", "None", true, $bf_developers, "Blender Foundation official release.");
|
||||
create_project("Addons", "None", true, $addon_developers, "Addon scripts and plugins for Blender.");
|
||||
create_project("Translations", "None", true, $translation_developers, "Localization of Blender in different languages.");
|
||||
create_project("BF Blender", "None", true, $bf_developers, "Blender Foundation official release.", true);
|
||||
create_project("Addons", "None", true, $addon_developers, "Addon scripts and plugins for Blender.", true);
|
||||
create_project("Translations", "None", true, $translation_developers, "Localization of Blender in various languages.", true);
|
||||
|
||||
/* modules */
|
||||
//create_project("None", "None", true, array(), ""); // None
|
||||
|
||||
@@ -60,7 +60,7 @@ set maniphest.priorities
|
||||
}
|
||||
|
||||
|
||||
Disable irrelevant applications and set policies (TODO figure out policies!)
|
||||
Disable irrelevant applications
|
||||
|
||||
|
||||
B) FILE STORAGE
|
||||
@@ -110,6 +110,8 @@ copy over dump/ folder
|
||||
|
||||
./import_projects.php
|
||||
|
||||
Set maniphest policies for Moderators (avoids it showing up in transactions)
|
||||
|
||||
|
||||
F) IMPORT TASKS
|
||||
===============
|
||||
|
||||
@@ -84,7 +84,7 @@ function create_task($user, $id, $title, $projects, $description, $assign_user,
|
||||
$changes = array();
|
||||
$changes[ManiphestTransaction::TYPE_STATUS] = ManiphestTaskStatus::STATUS_OPEN;
|
||||
$changes[PhabricatorTransactions::TYPE_VIEW_POLICY] = 'public';
|
||||
$changes[PhabricatorTransactions::TYPE_EDIT_POLICY] = 'admin'; // TODO which permission?
|
||||
$changes[PhabricatorTransactions::TYPE_EDIT_POLICY] = lookup_project("Moderators")->getPHID();
|
||||
|
||||
$template = new ManiphestTransaction();
|
||||
|
||||
@@ -210,7 +210,7 @@ function set_status($task, $user, $status, $date)
|
||||
->applyTransactions($task, $transactions);
|
||||
}
|
||||
|
||||
function create_project($name, $username, $active, $membernames, $blurb = '')
|
||||
function create_project($name, $username, $active, $membernames, $blurb = '', $admincontrol = false)
|
||||
{
|
||||
$user = lookup_user($username);
|
||||
|
||||
@@ -222,10 +222,15 @@ function create_project($name, $username, $active, $membernames, $blurb = '')
|
||||
|
||||
$xactions = array();
|
||||
|
||||
if($admincontrol)
|
||||
$editpolicy = "admin";
|
||||
else
|
||||
$editpolicy = lookup_project("Moderators")->getPHID();
|
||||
|
||||
/* policy */
|
||||
$project->setViewPolicy("public");
|
||||
$project->setEditPolicy("admin");
|
||||
$project->setJoinPolicy("admin");
|
||||
$project->setEditPolicy($editpolicy);
|
||||
$project->setJoinPolicy($editpolicy);
|
||||
|
||||
/* archived */
|
||||
if(!$active)
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
<p style="margin: 12pt 0;">Welcome to the new Blender developer website! Accounts and passwords from <a href="http://projects.blender.org">projects.blender.org</a> have been preserved and can still be used to log in.</p>
|
||||
|
||||
<p style="margin: 12pt 0;">This is a <b>test version</b> of the site, <b>any data you create here may be removed</b> before the final website goes live!</p>
|
||||
|
||||
Reference in New Issue
Block a user