mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
issue 2364 change random mid value
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11598 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
1105777c25
commit
79095100b7
1 changed files with 17 additions and 2 deletions
|
|
@ -391,7 +391,8 @@
|
|||
// if mid is empty, auto create mid
|
||||
if(!$request->module_id)
|
||||
{
|
||||
$request->module_id = $cmArgs->module.'_'.date('YmdHis');
|
||||
$randomMid = $this->_makeRandomMid();
|
||||
$request->module_id = $cmArgs->module.'_'.$randomMid;
|
||||
}
|
||||
$cmArgs->mid = $request->module_id;
|
||||
|
||||
|
|
@ -761,7 +762,8 @@
|
|||
$moduleInfo = $oModuleModel->getModuleInfoByMid($originMenu['url']);
|
||||
|
||||
$args->module_type = $moduleInfo->module;
|
||||
$args->module_id = $moduleInfo->mid.'_copy_'.date('YmdHis');
|
||||
$randomMid = $this->_makeRandomMid();
|
||||
$args->module_id = $moduleInfo->mid.'_copy_'.$randomMid;
|
||||
$args->layout_srl = $moduleInfo->layout_srl;
|
||||
|
||||
$oModuleAdminController = &getAdminController('module');
|
||||
|
|
@ -816,6 +818,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
private function _makeRandomMid()
|
||||
{
|
||||
$time = time();
|
||||
$randomString = "";
|
||||
for($i=0;$i<4;$i++)
|
||||
{
|
||||
$doc = rand()%26+65;
|
||||
$randomString .= chr($doc);
|
||||
}
|
||||
|
||||
return $randomString.substr($time, -4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Arrange menu items
|
||||
* @return void|object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue